Extra Flashcards

1
Q

Best, Average, worst time complexty

Quicksort
Mergesort
Bubble sort

A

Omega(nlogn), Theta(nlogn), O(n^2)

Omega(nlogn), theta(nlogn), O(nlogn)

Omega(n), theta(n^2), O(n^2)

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

Best, Average, worst time complexty

Insertion sort
Selection sort
Binary

A

Omega(n), theta(n^2),O(n^2)

Omega(n^2), theta(n^2), O(n^2)

Omega(logn), theta(logn), O(n)

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

Order from best to worst time complexity:

A

1, logn, n, nlogn, n^2,2^n,n!

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

Theta for:

Array

List

Binary

Hash

A

All n except for
Add()=1
get()=1

All n except for
Add() =1
Remove() =1

All logn

All constants

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