COSC 122 Test Flashcards

1
Q

Insertion sort best case

A

n (sorted array)

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

Insertion sort worst case

A

n^2

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

Insertion Avg

A

n^2

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

Selection sort Best case

A

n^2

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

Selection worst

A

n^2

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

Selection Avg

A

n^2

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

Sequential Sort big O

A

O(n)

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

Binary Search Big O

A

O(logn)

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

Shell sort best case

A

n (logn)

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

Shell sort worst/Avg

A

n(logn)^2

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

Hash table best/Avg

A

O(1)

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

Hash Successful equation

A

1 + (load_factor / 2)

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

Hash unsuccessful

A

load_factor

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

Insertion comparisons

A

n-1

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

Selection comparisons

A

(n(n-1))/2

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

sequential comparisons

A

(n+1)/2

17
Q

linear search best case

A

O(1)

18
Q

linear search worst/Avg

A

O(n)

19
Q

Binary search equation

A

log n

20
Q

log(2)1000

A

10

21
Q

log(2)1,000,000

A

20

22
Q

log(2)1,000,000,000

A

30

23
Q

log(4)16

A

2