The expected number of comparisons made by the algorithm before it terminates is n. This is because each comparison has an equal probability of 1/n of finding the given number x and thus, the expected number of comparisons is equal to the total number of comparisons (n).