We studied linear search, which searches an array A for an element X by starting
ID: 3625748 • Letter: W
Question
We studied linear search, which searches an array A for an element X by starting at index 0 and proceeding to look in indices 1, 2, 3, ..., Size-1 for X. Write the code for a function int ReverseLinearSearch(int A[], int Size, int X) which searches A for X in reverse order, i.e., starting at Size-1 and working down to 0. The function shall return the index of X or -1 if X is not found.