Algorithms Flashcards
1
Q
What is an algorithm?
A
A set of instructions/steps that solves a particular problem.
Each algorithm operates on INPUT DATA and produces an OUTPUT RESULT.
Each algorithm can be classified by HOW LONG IT TAKES TO RUN on a particular INPUT.
Each algorithm can be classified by the QUALITY OF ITS RESULTS.
2
Q
Linear Search
A
i.e] Search line by line for an answer, from top to bottom.
3
Q
Binary Search
A
Divide the search in half, then in half again until the answer is found. Worst case scenario, is to keep halving our search area.