In Exercise, write the steps in pseudocode needed to perform the task described.
Exercise
Let [a1, a2), [a2, a3), …, [aN-1, aN] be N adjacent intervals on the real line. If A[1], …, A[N] contain the numbers a1, …, an, respectively, and X is a real number, write an algorithm that computes a variable INTERVAL as follows: If X is not between a1 and aN, INTERVAL = 0; however, if X is in the ith interval, then INTERVAL = i. Thus INTERVAL specifies which interval (if any) contains the number X.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.