CST 370 week 1

Week 1 of CST 370 introduced what an algorithm is: a finite sequence of unambiguous steps that turns a valid input for a problem into the required output. The GCD problem showed why the definition matters, and contrasted Euclid's algorithm against the middle-school procedure, which is not an algorithm because it has ambiguous steps. The pseudocode lecture set the notation for writing pseudocode which is purposefully different from writing actual code, so the logic of the algorithm takes the focus instead of language or system specific implementation details. We should analyze the problem first, then write the algorithm solution in pseudocode, then code.


Up next was groundwork on some key problem types and data structures. Problem types covered were sorting, searching, and graphs. We then reviewed graph definitions and representations, and trees as a special type of graphs. Most of this was review from intro to algorithms.


The analysis framework picks a basic operation, usually in the innermost loop, and counts how often it runs against n, giving the eight efficiency classes: constant, log n, n, n*log n, n², n³, 2ⁿ, and n!. The practical takeaway is how many operations finish in about a second (millions for n log n, ~10,000 for n², ~30 for 2ⁿ), which is why so much design effort goes into reducing algorithmic time complexity. This is what the course is ultimately about!

Comments

Popular posts from this blog

week 15-16/100

week 8/100

CST 334 Week 3 (27/100)