Question: 1 Lnear Search on sorted list (a) Write pseudocode for linear search, assuming that the input list is already sorted, and also return the would-be
1 Lnear Search on sorted list (a) Write pseudocode for linear search, assuming that the input list is already sorted, and also return the would-be index for the key if the key is not in the list. Note: Your algorithm should take advantage of the fact that the list is sorted, but still looks for the value by comparing the list elements one by one with the value. Problom: Linear Search in a sorted (in ascending order) 1ist Input: list A[1... n: the length of listA v: the value ve are searching A(1...n] for and A[1]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
