Sorting Algorithms Flashcards

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

Heap sort

A

Worst - O(nlogn)

Avg - O(nlogn)

Best - O(nlogn)

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

Insertion sort

A

Worst - O(n^2)

Avg - O(n^2)

Best - O(n)

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

Merge sort

A

Worst - O(nlogn)

Avg - O(nlogn)

Best - O(nlogn)

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

Quicksort

A

Worst - O(n^2)

Avg - O(nlogn)

Best - O(nlogn)

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

Quickselect

A

Worst - O(n^2)

Avg - O(n)

Best - O(n)

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

Hash Table

A

Worst

  • Search O(n)
  • Insertion O(n)
  • Deletion O(n)

Avg

  • Search O(1)
  • Insertion O(1)
  • Deletion O(1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Binary Heap

A

Heapify O(n)

Find Max O(1)

Increase Key O(logn)

Insert O(logn)

Delete O(logn)

Merge O(m+n)

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

Linked List (sorted)

A

Find Max O(1)

Increase Key O(n)

Insert O(n)

Delete O(1)

Merge O(m+n)

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

Linked List (unsorted)

A

Find Max O(n)

Increase Key O(1)

Insert O(1)

Delete O(1)

Merge O(1)

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

Theta

A

Upper and lower, tight bound

equal to

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

Big O

A

Upper bound

Less than or equal to

Worst case (not always)

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

Omega

A

Lower bound

Greater than or equal to

Best case (not always)

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

Basic array

A

Worst & Avg.

  • Indexing O(1)
  • Search O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly