Match the amino acid given in List-I with their one-letter code given in List-II \[ \begin{array}{|l|l|} \hline \textbf{Name of amino acid} & \textbf{One-letter code} \\ \hline (A) \; \text{Lysine} & (I) \; W \\ \hline (B) \; \text{Tryptophan} & (II) \; Q \\ \hline (C) \; \text{Tyrosine} & (III) \; K \\ \hline (D) \; \text{Glutamine} & (IV) \; Y \\ \hline \end{array} \]
Given a list numList of n elements and key value K, arrange the following steps for finding the position of the key K in the numList using the binary search algorithm i.e. BinarySearch(numList, key).
numList
K
BinarySearch(numList, key)
mid = (first + last) // 2
first = 0, last = n - 1
first <= last
numList[mid] = key
numList[mid] > key
last = mid - 1
first = mid + 1