CS Interview Questions Flashcards

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

Time/Space (best/avg/worst) Complexity Merge Sort

A
Time:
Best: O(n log(n))
Avg: O(n log(n))
Worst: O(n log(n))
Space: 
O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Time/Space (best/avg/worst) Complexity Quick Sort

A

Time:
Best: O(n log(n))
Avg: O(n log(n))
Worst: O(n^2)

Space:
O(log(n))

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

Time/Space (best/avg/worst) Complexity Time Sort

A

Time:
Best: Ω(n)
Avg: O(n log(n))
Worst: O(n log(n))

Space:
O(n)

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

Time/Space (best/avg/worst) Complexity Heap Sort

A

Time:
Best: Ω(n log(n))
Avg: O(n log(n))
Worst: O(n log(n))

Space:
O(1)

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

Time/Space (best/avg/worst) Complexity Bubble Sort

A

Time:
Best: Ω(n)
Avg: O(n^2)
Worst: O(n^2)

Space:
O(1)

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

Time/Space (best/avg/worst) Complexity Insertion Sort

A

Time:
Best: Ω(n)
Avg: O(n^2)
Worst: O(n^2)

Space:
O(1)

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

Time/Space (best/avg/worst) Complexity Selection Sort

A

Time:
Best: Ω(n^2)
Avg: O(n^2)
Worst: O(n^2)

Space:
O(1)

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

Time/Space (best/avg/worst) Complexity Tree Sort

A

Time:
Best: Ω(n log(n))
Avg: Θ(n log(n))
Worst: O(n^2)

Space:
O(n)

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

Time/Space (best/avg/worst) Complexity Shell Sort

A

Time:
Best: Ω(n log(n))
Avg: Θ(n(log(n))^2)
Worst: O(n(log(n))^2)

Space:
O(1)

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

Time/Space (best/avg/worst) Complexity Bucket Sort

A

Time:
Best: Ω(n+k)
Avg: Θ(n + k)
Worst: O(n^2)

Space:
O(n)

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

Time/Space (best/avg/worst) Complexity Radix Sort

A

Time:
Best: Ω(nk)
Avg: Θ(nk)
Worst: O(nk)

Space:
O(n+k)

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

Time/Space (best/avg/worst) Complexity Counting Sort

A

Time:
Best: Ω(n+k)
Avg: Θ(n+k)
Worst: O(n+k)

Space:
O(k)

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

Time/Space (best/avg/worst) Complexity Cube Sort

A

Time:
Best: Ω(n)
Avg: Θ(n log(n))
Worst: O(n log(n))

Space:
O(n)

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