COSC 122 Test Flashcards
1
Q
Insertion sort best case
A
n (sorted array)
2
Q
Insertion sort worst case
A
n^2
3
Q
Insertion Avg
A
n^2
4
Q
Selection sort Best case
A
n^2
5
Q
Selection worst
A
n^2
6
Q
Selection Avg
A
n^2
7
Q
Sequential Sort big O
A
O(n)
8
Q
Binary Search Big O
A
O(logn)
9
Q
Shell sort best case
A
n (logn)
10
Q
Shell sort worst/Avg
A
n(logn)^2
11
Q
Hash table best/Avg
A
O(1)
12
Q
Hash Successful equation
A
1 + (load_factor / 2)
13
Q
Hash unsuccessful
A
load_factor
14
Q
Insertion comparisons
A
n-1
15
Q
Selection comparisons
A
(n(n-1))/2
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