4.4.4 Classification of Algorithms Flashcards

1
Q

What is used to compare algorithms?

A

Space and time complexity.

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

What are the four methods of comparing algorithms?

A

Factorials (permutations)
Big O notation.
Function mapping
Time vs space complexity.

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

What is big o notation used for?

A

Describing the complexity of an algorithm, always assuming the worst case scenario.

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

What is the big o notation for linear search.

A

O(n)

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

What is the big O notation for bubble sort.

A

O(n2)

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

What is the big o notation for merge sort

A

O(nlog(n))

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

What is the big O notation for binary search?

A

O(log(little2(n))

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

What are the two measurements of the limitations of computation.

A

Tractability and intractability

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

Define a tractable problem

A

Have a polynomial or less time solution.

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

On a graph, what do all functions, except constant, grow by?

A

All functions grow, as the input increases.

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

What is the big o notation for constant?

A

O(c)

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

What is the big O notation for logarithmic?

A

O(log(small2(n))

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

What is the big o notation for linear?

A

O(n)

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

What is the big o notation for linear logarithmic?

A

O(nlog(n))

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

What is the big o notation for polynomial?

A

O(n^2)

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

What is the second big o notation for polynomial, in terms of checking 3D coordinates?

17
Q

What is the big o notation for exponential?

18
Q

What is the big o notation for factorial?

19
Q

What is a tractable problem?

A

A problem that can be solved within a useful period of time.

20
Q

What is an intractable problem?

A

Effectively insoluble problems as they take too long to solve which is unlikely to be useful - due to the limitations of computation.

21
Q

How can intractable problems be solved?

A

Using heuristics to provide an approximate solution to a problem.

22
Q

What is the problem with using heuristics as a method of solving intractable problems.

A

They are not optimal and are only approximate solutions.

23
Q

What does the halting problem demonstrate?

A

That there are some problems which can not be solved by computers.

24
Q

What are factorials useful for?

A

Calculating permutations.

25
What is the halting problem?
It is impossible to write an algorithm to determine if another algorithm will finish with a given input.
26
What is Computability?
Whether a problem can be solved or not.
27
What is feasability?
How efficiently a problem can be solved
28
What is time as a measurement of feasibility?
How long the algorithm takes to execute.
29
What is space as a measure of feasabiltiy?
How much memory the algorithm used for the storage of data during execution.
30
What happens when more than one algorithm exists?
There can be a trade off between time and space efficiency. One may be quicker but requires more memory than another.
31
How do we measure efficiency?
The amount of space and time depends on the numbers of inputs to a specific algorithm.
32
How do we express efficiency:
A function of the numbers of inputs to algorithms aka N
33
In terms of time complexity, what are the influencing factors?
Processor clock speed. Efficiency of hardware implementation of operations used. Other processes executing concurrently.
34
What does big o notation focus on?
The algorithm rather than the hardware that is being executed on.
35
Outline the best case scenario.
An initial list is already ordered and the algorithm terminates after on iteration.