2.3.2. Algorithms for the Main Data Structures Flashcards

(18 cards)

1
Q

What 2 pieces of informations allow you to analyse an algorithm?

A
  1. time complexity 2. space complexity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is meant by the time complexity of an algorithm?

A

the amount of time required to solve a particular problem

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

What is the notation for time complexity?

A

big-O-notation

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

What does big-O notation show?

A

the effectiveness of an algorithm

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

What is big-O notation good for?

A

predicting the amount of time taken to solve an algorithm given the number of items input

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

What does a linear time complexity mean?

A

the amount of time taken to complete an algorithm algorithm is directly proportional to the number of items input

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

What does a constant time complexity mean?

A

the amount of time taken to complete an algorithm is independent of the number of items input

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

What does a polynomial time complexity mean?

A

the amount of time taken to complete an algorithm is proportional to the number of items input, to the power of n

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

What does an exponential time complexity mean?

A

the amount of time taken to complete an algorithm is proportional to 2 to the power of the number of items input

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

What does a logarithmic time complexity mean?

A

the amount of time taken to complete an algorithm will increase at a smaller rate as the number of items input increases

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

What is a logarithm?

A

how many times a certain number (base) is multiplied by itself to reach another number

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

What is space complexity?

A

the amount of storage an algorithm takes up

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

What is an algorithm?

A

a series of steps that complete a task

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

How do you reduce the space complexity?

A

complete all operations on a single data set

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

How do you reduce the time complexity of an algorithm? (2 steps)

A
  1. reduce the amount for loops 2. reduce the amount of items, operations are completed on
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the big-O notation of a linear search algorithm?

17
Q

What is the big-O notation of binary search algorithm?

18
Q

What is the big-O notation of a bubble sort algorithm?