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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Linear Search

A

i.e] Search line by line for an answer, from top to bottom.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly