CST 370 Week 1 Learning Journal Entry
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.
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 becomes a "game plan" that the coder can use to structure his solution via code. They are general steps that need to be coded so that the problem is solved, where the steps are not written in any specific programming language.
Once an algorithm is written, it should be analyzed to test its time efficiency and space complexity. Both are important since the size of the input can affect both efficiencies. Because algorithms' efficiency can differ for inputs of the same size, it is important to look at worst-case, best-case, and average-case efficiencies. While these cases are important, the framework analysis primarily remains focused on the run time as the input size grows toward infinity.
Comments
Post a Comment