Posts

Showing posts from January, 2025

CST 370 Week 3 Learning Journal Entry

Image
 Brute Force Design Techniques and Divide-and-Conquer  This week, we learned about different exhaustive search algorithms that used a Brute-Force design technique. Exhaustive search algorithms consider every possible case before coming to a conclusion.  The first algorithm discussed was the sequential search and matching algorithm. This algorithm was presented in the form of searching a string to find a pattern, such as the one below. In this algorithm, every character in a string is checked for the pattern until the end of the pattern is reached. The efficiency of this algorithm is dependent on the text and pattern. In the example below, there are 16 characters in the text and 4 characters in the pattern that we are looking for. Since we are considering all comparisons and cases, we should have 13 shifts and 52 comparisons.  Another exhaustive search was conducted for combinatorics problems. An exhaustive search can be used to solve problems such as the Traveling Sa...

CST 370 Week 2 Learning Journal Entry

Image
Asymptotic Notations  This week, we learned about asymptotic notation and its use when analyzing recursive and nonrecursive algorithms. Last week, we learned about identifying the basic operation of an algorithm, which is the operation that contributes the most to the total running time. After all operations of an algorithm are analyzed and a basic operation is found, we can assign a function to the algorithm that represents the time efficiency of the algorithm. There are 8 common time efficiencies that are used. These can be found below and are in order from fastest (top) to slowest (bottom):  Once a function is assigned, we can use one of three asymptotic bounds and notations to display the order of growth of an algorithm. The three types of notation that can be used when analyzing an algorithm: Big 'O' (oh) Big 'Θ' (theta) Big 'Ω' (omega) Big 'O' Notation Big 'O' is used as an upper asymptotic bound and is written as O(f(n)). This means that a...

CST 370 Week 1 Learning Journal Entry

Image
Algorithms and Analysis Framework This was our first week in CST 370, which focused on algorithms and analysis frameworks. An algorithm is a "sequence of unambiguous instructions for solving a problem." When you describe the sequence of steps, there is only one way to interpret it. For example, when finding the greatest common denominator, we can use Euclid's algorithm, which is found below.  Euclid's algorithm (left) shows clear directions on how to find the greatest common denominator.  The right shows another method for finding the greatest common denominator, the Middle school procedure. This method is not considered an algorithm because prime factorization is not defined and is considered ambiguous, as there are multiple ways to find a number's prime factors.  Developing an algorithm is an important process before the code is developed. When a problem arises, the algorithms to solve the problem should be written out first before coding begins. The algorithm b...