Algorithms PDF
Algorithms PDF
Formal Definition
• We now move from our current intuitive understanding
of an algorithm to a formal one
• Naming and storage — Notation for “holding on” to certain values and referring to them in
various parts of an algorithm (e.g., variables like x, index, or valueList)
• Sequencing — Clear indication of the order in which an algorithm’s steps will occur
• Conditions and branching — Different paths that an algorithm may follow based on some
decision or state
Making change
Contradiction — See if you can solve an “opposite” problem, then “invert” the solution