Searching Algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Which searching algorithm requires data to be sorted before starting?

A

Binary search

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

Which example shows linear search?

A

C

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

Perform a linear search for 9 on the values 1 3 6 7 9 12 15.

A

The linear search will find 9 at the 4th position in the array.

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

What is the time complexity of binary search?

A

O(log n)

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

Which example shows binary search?

A

B

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

Perform a binary search for 6 on the values 1 3 6 7 9 12 15.

A

The binary search will find 6 at the 3rd position in the array.

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

Which searching algorithm has a time complexity of O(n)?

A

Linear search.

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

Front

A

Back

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

Which searching algorithm requires data to be sorted before starting?

A

Binary search

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

Which example shows linear search?

A

C

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

Perform a linear search for 9 on the values 1 3 6 7 9 12 15.

A

The linear search will find 9 at the 4th position in the array.

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

What is the time complexity of binary search?

A

O(log n)

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

Which example shows binary search?

A

B

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

Perform a binary search for 6 on the values 1 3 6 7 9 12 15.

A

The binary search will find 6 at the 3rd position in the array.

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

Which searching algorithm has a time complexity of O(n)?

A

Linear search.

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