Classification of Algorithms Flashcards

1
Q

What is abstraction?

A

The process of making a problem simpler by removing or hiding features.

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

What is representational abstraction?

A

what remains after unnecessary details are removed e.g. the London underground map in which geographical details are all hidden.

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

what is generalisation abstraction?

A

identifying key features of a problem to identify the problem as a more general set of problems.

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

How does OOP implement information hiding?

A

a class encapsulates all of its private attributes and methods which are exposed only through its interface which could be the public methods.

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

What is procedural abstraction?

A

ensures that subroutines are as generalised and as re-usable as possible.
- using a more general subroutine name
-splitting the user interface and processing of data into separate subroutines.

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

What is functional abstraction?

A

aims to hide the complexity of an algorithm or how a part of the program works using subroutines.

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

What is data abstraction?

A

allows you to separate how a complex data structure is used from how it is constructed.

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

What is problem reduction?

A

removing unnecessary detail from a problem to reduce the problem to one that has already been solved.

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

What is decomposition?

A

Breaking a large problem into smaller sub problems.

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

What is composition?

A

combining parts of a solution together to form a solution made up of component part

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

Automation

A

Designing, implementing and executing a solution to solve a problem automatically.
done by
- Implementing the data structures to store the data
- Implementing the algorithms to process the data

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

Time wise complexity

A

algorithms that have a lot of steps or comparisons will take longer to compute

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

Space wise complexity

A

algorithms that store a lot of temporary values while the processes take place will take up a lot of memory

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

Example of constant time O(1)

A
  • finding the first item in a list
  • jumping straight to a value at a given index
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Example Logarithmic time O(logn)

A

Binary search

takes very little time because the possible list of remaining values os halved each time

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

Example of linear time O(n)

A

linear search

17
Q

example loglinear time O(n log n)

A

merge sort
very efficient like binary search but sort is more complex than search so time wise complexity is larger

18
Q

example of polynomial time O(n^2)

A

Bubble sort
insertion sort
selection sort

19
Q

Exponential time O(k^n)

A

trying every possible value of a passcode

20
Q

order the time wise complexities from most to least efficient

A

O(1), O(logn), O(n), O(nlogn), O(n^2), O(k^n), O(n!)

21
Q

What is a tractable problem?

A

A problem which can be solved in a reasonable amount of time - polynomial or less

22
Q

What is an intractable problem?

A

A problem that can be solved but not in a reasonable amount of time - exponential or factorial time

23
Q

what is the tike complexity of a recursive algorithm?

A

O(2^n)

24
Q

Heuristic

A

an approach to solving intractable problems in a reasonable amount of time by accepting an imperfect solution

25
Q

strategies for tackling an intractable problem

A

-reducing the complexity of the problem
- accepting a close to optimal solution
- using algorithm that used a best guess or estimate based on experience

26
Q

Computable

A

a problem that can be solved by a computer

27
Q

Non- computable

A

problem that cannot be solved by a computer

28
Q

The halting problem

A

it is not possible to come up with a method that, given a program and its inputs, but without running the program, can tell if the program will halt.

29
Q

What is the significance of the halting problem?

A

demonstrates that there are some problems that cannot be solved using a computer

30
Q

Components of a Turing machine

A
  • a finite set if states
  • a finite alphabet if symbols
  • an infinite length of tape with marked off squares
  • a read write head that can travel across the tape one square at a time
  • a set of rules
31
Q

Importance of Turing machines:

A

Turing machines provide a (general/formal) model of computation and provide a definition of what is computable.

32
Q

Universal Turing Machine

A

A turing machine that can simulate any turing machine due to it being given a standard description/transition rules at the start.