Binary and Linear Search [2.4] Flashcards

1
Q

How does a Binary Search work?

A

Immediately checks midpoint of list and discards irrelevant half.

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

How does a Linear Search work?

A

A linear search is the simplest method of searching a data set.

Starting at the beginning of the data set, each item of data is examined until a match is made. Once the item is found, the search ends.

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

What are the conditions needed to carry out a Binary search?

A

The numbers must be ordered.

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

What can Linear search do that Binary cannot?

A

Search unordered lists.

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