What do you think about my Software Development Concepts Project?

Portfolio Project from Introduction to IT: Software Development Concepts Project
To this project - Click here

This is my Blog Post on Medium (It’s in german)

Translation in english:

How do you develop a pattern search algorithm?

For what?
Pattern search algorithms play a central role in modern software development. They allow us to specifically search for specific values or character sequences within a large data set. An everyday example of this is searching for a specific word in a digital dictionary or in a large text document.

Imagine you are tasked with checking for errors in a large amount of log files. Each log could contain numerous entries, such as:
“ERROR: Invalid function arguments”.
In order to efficiently find the word “ERROR” without having to manually search through each log, developing an automated search algorithm is essential. This algorithm would not only speed up the search but also inform the user whether the searched word was found. In our example, “ERROR” would be marked as found, whereas a word like “Hello” would be marked as not present.

First, we start by developing a design for our algorithm. This first step serves as a basis and tool for organizing our thoughts. We then visualize the process in a flowchart, which enables an intuitive understanding of the processes. Finally, we formulate the design as pseudocode, which serves as a bridge to the actual implementation in a programming language.

Design steps for our search algorithm
1. Preparing the body of the text: First we need to prepare the entire body of the text in which we are going to search. In our scenario this would be the contents of the log files.

2. Definition of the search pattern: This is followed by identifying the pattern that we want to search for. This could be a specific error code like “ERROR” or any other string of interest.

3. Start of the search: The actual search process starts at this point. We search the text from the beginning and compare each character with the beginning of the search pattern.

4. Character-by-character comparison: For each character in the text, we check whether it matches the first character of the pattern. If we find a match, we check the following characters in the text for a complete match with the pattern.

5. Tracking matches: To track the progress of our search, we use a variable match_count. We increase this with every character match we find.

6. Evaluating the results: Once we reach the end of the pattern, we check whether match_count equals the length of the pattern. If this is the case, the pattern has been found and the user will be informed accordingly. Otherwise, we continue searching until we either find a match or reach the end of the text.

Our algorithm in the flowchart

Our pseudocode conversion

define text
define pattern
IF the entire text hasn't been searched:
  iterate to the next character of the text
  create a match_count variable and set it to 0
  IF the entire pattern hasn't been searched:
    IF this character from the pattern is equal to the character from text:
      increment the match_count variable
  IF match_count is equal to the length of the pattern:
    pattern found!
ELSE
    pattern not found!

Conclusion
In this look at developing a search algorithm, we’ve deliberately simplified things. The reason for this is clear: to make complexity understandable. We’ve seen how an abstract problem is broken down into concrete steps — from body text to search pattern to pseudocode representation. This process demonstrates not only how our algorithm works, but also how we can make it intuitively accessible. The goal is to create a solid understanding that serves as a foundation for later, more complex problems in software development. Because sometimes the easiest way is the best starting point for great things.


What dou you think about this Post?
Are there things I can improve? Thanks in advance :slight_smile: