Asymptotic Efficiency Flashcards

1
Q

Class 1

A

Constant, running time doesn’t change based off input (simple equations)

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

Class log n

A

Logarithmic, typically occurs by cutting down a problem’s size by a constant factor iteratively (Binary search)

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

Class n

A

Linear, running time increases at the same rate as input (Linear search)

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

Class n log n

A

Linearithmic, occurs with many divide and conquer algorithms including average mergesort and quicksort (Mergesort, quicksort)

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

Class n^2

A

Quadratic, typically algorithms with 2 embedded loops

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

Class n^3

A

Cubic, typically algorithms with 3 embedded loops

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

Class 2^n

A

Exponential, typically for algorithms that generate all subsets of an n element set

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

Class n!

A

Factorial, typical for algorithms that generate all permutations of an n element set (Travelling salesman via brute force)

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

P class problem

A

All problems that can be solved with polynomial time complexity with respect to size of the input

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

NP class problem

A

All problems that cannot be determined or solved in polynomial time, however correct solutions can be verified in polynomial time given right information

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

NP-Complete

A

Subset of NP class where once one can be solvable in polynomial time, they can all be solved in polynomial time (Travelling Salesman decision problem)

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

NP-Hard

A

Can neither be solved or have possible solutions verified for correctness in polynomial time (Knapsack 0-1 optimisation problem)

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

Tractable

A

Problems that can be solved in polynomial time

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

O(1) tractable or intractable?

A

tractable

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

O(n) tractable or intractable?

A

tractable

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

O(n log n) tractable or intractable?

A

tractable

17
Q

O(n^2) tractable or intractable?

A

tractable

18
Q

O(2^n) tractable or intractable?

A

intractable

19
Q

O(n!) tractable or intractable?

A

intractable

20
Q

O(n^k) tractable or intractable?

A

intractable

21
Q

Intractable

A

problems where the quickest algorithms run in exponential or worse time complexities

22
Q

Master theorem

A

T(n)=aT(n/b)+kn^c

23
Q

T(n)=aT(n/b)+kn^c, logba < c

A

T(n)=O(n^c)

24
Q

T(n)=aT(n/b)+kn^c, logba = c

A

T(n)=O(n^c log n)

25
Q

T(n)=aT(n/b)+kn^c, logba > c

A

T(n)=O(n^(logba))

26
Q

Big Oh

A

Upper bound of a worst case performance of the algorithm

27
Q

Big Omega

A

Lower bound of a worst case performance of the algorithm