WEEK 3: COMPLEXITY Flashcards

(15 cards)

1
Q

refers to the measure of the computational resources used by an algorithm to solve a problem. these resources typically include time and space, and the goal is to minimize their usage to achieve optimal performance

A

algorithm efficiency

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

this measures the amount of time an algorithm takes to complete as a function of the size of the input

A

time complexity

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

time complexity is often expressed using this

A

big-O notation

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

this describes the upper bound of the algorithm’s running time

A

big-O notation

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

constant time, where running time does not depend on the input size

A

O(1)

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

logarithmic time, where the running time grows logarithmically with the input size

A

O(logn)

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

linear time, where the running time grows liearly with the output

A

O(n)

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

linearithmic time, common in efficient sorting algorithms like mergesort and heapsort

A

O(n logn)

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

quadratic time, where the runnng time grows quadratically with the input size, common in algorithms like bubblesort

A

O(n^2)

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

time complexity of heapsort

A

O(n logn)

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

time complexity of mergesort

A

O (n logn)

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

time complexity of bubblesort

A

O(n^2)

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

time complexity of a linear search algorithm

A

O(n)

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

measures the amount of memory an algorithm needs to run as a function of the input size. it includes both the memory needed to store the input data and the memory neede for auxillary variables and data structures

A

space complexity

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

space complexity of a recursive algorithm

A

O(n)

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