Alogrithms
-
[Introduction to Algorithms, CLRS] Exercises 2.1-3알고리즘 2017. 9. 16. 17:32
This is a solution for Introduction to Algorithms. I write this for my study purpose. Exercises 2.1-3 Consider the searching problem: Input: A sequence of n numbers A = and a value v. Output: An index i such that v = A[i] or the special value NIL if v does not appear in A. Write pseudocode for linear search, which scans through the sequence, looking for v. Using a loop invariant, prove that your..