4.04 Classification Of Algorithms. Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Define computability:

A

Concerned with where a problem can or cannot be solved.

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

Define feasibility.

A

Concerned with how efficiently a problem can be solved.

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

What are the two standard measureS of the efficiency of an algorithm.

A

Space and time.

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

What is time?

A

How long the algorithm takes to execute.

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

What is space?

A

How much memory the algorithm uses for the storage of data during execution.

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

What happens when more than one algorithm exists which can solve a problem?

A

There is a trade off between time and space e.g. one solution may be quicker but requires more memory than another solution.

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

How do we measure efficiency?

A

The amount of space and time required varies depending on the number of inputs to the algorithm, therefore efficiency is normally expressed as a function of the number of inputs to an algorithm, commonly referred to as ‘n’.

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

How else can we measure efficiency.

A

Space complexity.
Time complexity:
processor clock speed
Efficiency of hardware implementation of
operations used.
Other processes executing concurrently.

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

How do we measure time complexity?

A

Using the big O notation, which allows us to focus on the algorithm rather than the hardware it is being executed on.

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

How can the order or magnitude of an algorithm be expressed?

A

As a function of it size.

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

What does a function map do?

A

A function maps one set of values onto another.

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

How do we express linear function?

A

f(x) = ax+c

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

How does fx increase?

A

In a straight line.

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

How do we express a polynomial function?

A

f(x) = axm + bx + c

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

How do we express an exponential function?

A

f(x) = ab^x

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

How do we express a logarithmic function?

A

f (x)= a logn x

(Little n)

17
Q

What is a logarithm of a number?

A

The power that the base must be raised to to make it equal to the number.

18
Q

What is the permutation of an object?

A

The permutation of a set of objects is the number of ways of arranging the objects within that set.

19
Q

Outline an example of permutation.

A

Example : with 3 objects A,B,C, we can choose any to be the first object.
You then have two choices for the second object which gives use 3x2=6 possible permutations
ABC,ACB,BAC,BCA,CAB,CBA

20
Q

What is formula for calculating the number of permutations n objects?

A

N factorial or expressed as n!

21
Q

How is the time efficiency of an algorithm established?

A

Identify the basic operation that is performed by the algorithm.
Established how many times this operation is carried out as a function of the number of inputs (n).
Consider how quickly this value grows and identify the dominant part it this (e.g. in 4n^2+3 the dominant part is n^2 as it will have the most impact).
This is the order of complexity of the algorithm. It is written as as O(g) where g is the growth rate.

22
Q

Linear time complexity algorithm example:

Algorithm for summing a list of numbers in a file:

TOTAL = 0
WHILE NOT at end of file 
READ Number from file
Total = Total + number
END WHILE
PRINT TOTAL

What is the basic operation?

How many times is it carried out?

Som if a file contained n items, how many times would it be carried out?

What is the order complexity?

A

Total = Total + Number

It is in a loop, executed once for each number in the file.

So, if a file contained n items the basic operation would be executed n times.

The algorithm is said go have order complexity O(n)l

23
Q

What else does the efficiency of some algorithms depend on?

A

The values of the inputs made to them.