Big o nation Flashcards

1
Q

Linear Search Code

A

time: O(n), space: O(1)

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

Binary Search Code

A

O(log n),space: O(1)

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

Bubble Sort Code

A

Time Complexity: O(n²)
Space Complexity: O(1)

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

Selection Sort Code

A

Time Complexity: O(n²)
Space Complexity: O(1)

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

Insertion Sort Code

A

Time Complexity: O(n²)
Space Complexity: O(1)

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

QuickSort Code

A

Time Complexity: O(nlog2(n)) on average, O(n²) for worst case
Space Complexity: O(log2(n))

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

Quickselect Code

A

Time Complexity: O(n).
Space Complexity: O(n) for recursion call stack in worst case. On average : O(Log n)

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

Mergesort Code

A

Time Complexity: O(nlog2(n))
Space Complexity: O(n)

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

Count Sort Code

A

Time Complexity: O(n + k) where k is the range of the input.
Space Complexity: O(k)

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

Binary tree

A

Time: O(logn), Space: O(logn)

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