Big-O Flashcards

1
Q

Bubble Sort Run Time

A

O(n2)

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

Selection Sort Run Time

A

O(n2)

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

Linear Search Run Time

A

O(n)

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

Binary Search

A

O(log n)

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

avg linear checks

A

n/2

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

avg binary checks

A

2^n

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

Runtime represents…

A

the amount of work done on the program

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

.this refers to the…

A

instance variable

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

How does selection sort work?

A

finds the smallest and moves it to the first point, then continues the process

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

How does bubble sort work?

A

compares first point to the point to the right of it, and swaps with it if it is smaller, then continues the process with the new number.

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

How does linear search work?

A

Starts from the beginning and continues until the key is found

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

How does binary search work?

A

Starts in the middle and continues either to the left or to the right until the key is found

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