Algorithms Flashcards

1
Q

Algorithms

A

set of steps for solving an instance of a particular problem type

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

Computational desiredata

A
  • correctness

- efficiency: run time, storage

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

Search

A

look for first instance of particular value in collection

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

Exact method

A
  • calculate solution with guaranteed correctness

- brute force, divide and conquer

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

Approximate

A
  • estimate solution ideally with additional estimate of how close this is to exact solution
  • simulation
  • heuristic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Brute force

A
  • generate and test
  • Assumptions: candidate answer easy to test, ordered, can be generated exhaustively
  • Strategy: test candidate answer one by one until solution is found
    e. g. linear search
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Divide and conquer

A

Strategy: solve smaller sub problem, extend sub solution to create solution of original problem
e.g. binary search, relates closely to recursion

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

Simulation

A
  • randomly simulate large number of data to predict overall trend
  • use multiple runs to verify stability of answer
  • used where it is possible to describe individual properties of a system, not to capture the interaction between them
    e. g. weather forecast
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Heuristic

A
  • search via cheap, approximate solution which works reasonably well most of the time but there is not proof of how close to optimal the proposed solution is
    e. g. play lower valid card every play
How well did you know this?
1
Not at all
2
3
4
5
Perfectly