Algorithm Correctness and Termination Flashcards

1
Q

What is algorithm correctness?

A

Proof that an algorithm produces the expected output for all valid inputs.

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

What is termination in algorithms?

A

A property ensuring an algorithm always reaches a stopping condition.

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

What is an invariant in algorithms?

A

A property that remains true at each step of execution (used in loop invariants).

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

How do you prove an algorithm is correct?

A

Using induction or loop invariants.

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