This problem invites you to demonstrate your ability to translate your understanding of algorithms into a good candidate
Posted: Thu Jul 14, 2022 2:12 pm
solutions should be short explanations like theSelectionSort example above, do not make it too long orcomplex.
This problem invites you to demonstrate your ability to translate your understanding of algorithms into a good candidate for an invariant for each of several relatively simple algorithms. For each of the following algorithms discussed in lecture, give a precise and concise description of an invariant for the algorithm that would support an argument about the correctness of the algorithm: Example: SelectionSort Solution: One very good invariant for SelectionSort would be: "After iteration I, the first I entries of the array are sorted, and they contain the first I entries of the final result of the fully sorted array." (a) InsertionSort (b) BubbleSort (c) Interval Task Partitioning
This problem invites you to demonstrate your ability to translate your understanding of algorithms into a good candidate for an invariant for each of several relatively simple algorithms. For each of the following algorithms discussed in lecture, give a precise and concise description of an invariant for the algorithm that would support an argument about the correctness of the algorithm: Example: SelectionSort Solution: One very good invariant for SelectionSort would be: "After iteration I, the first I entries of the array are sorted, and they contain the first I entries of the final result of the fully sorted array." (a) InsertionSort (b) BubbleSort (c) Interval Task Partitioning