Lecture 1 Flashcards

1
Q

Name the most important problem types

A

Sorting, searching, string processing, graph, geometric, combinatorial and numerical problems

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

What is a loop variant?

A

a logical predicate such that if it is satisfied before entering any single iteration of the loop then it is also satisfied after the iteration

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

What are the three components of a loop variant

A

Initialization: It is true prior to the first iteration of the loop.
Maintenance: If it is true before an iteration of the loop, it remains true before the next iteration.
Termination: When the loop terminates, the invariant gives us a useful property that helps show that the algorithm is correct.

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