Linear & Bianry Search Algorithms Flashcards

1
Q

An algorithm

A

A sequence of instructions that perform a specific task when followed

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

A computer program

A

An implementation of an algorithm

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

Binary search

A

Continually divides list in 2, eliminating the item that cannot have your item in it

The list must be fully ordered first to eliminate with any certainty

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

Linear search

A

Works by checking each element to see if it matches the code
Repeats until a match is found or whole list is checked

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

Difference between linear and binary

A

Works by simplification where as linear is brute force

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