Question: The sequential search algorithm of Figure 2.13 doesn't work when the numbers in the reverse directory are not unique. For example, if Raj is listed

The sequential search algorithm of Figure 2.13 doesn't work when the numbers in the reverse directory are not unique.
For example, if Raj is listed with a number of 1234 and Maria also has the number 1234, the algorithm would only print the first person found and then stop.
Modify the algorithm so that it prints EVERY occurrence of NUMBER in the directory along with the name (Both Raj and Maria would print).
2) (2 points)
Modify your improved algorithm from #1 so that it also prints out the number of occurrences found. (In the case of Raj and Maria sharing the number 1234, the algorithm would print that there were 2 occurrences)
 The sequential search algorithm of Figure 2.13 doesn't work when the

on. @The Sequentia LA-Assignment /DInvitation toexeSharedwith mGw y/Downloads/GMichael%20Schneider%20Judith%20Gersting-Invitation%20to%20Computer%20Science-Cour Chapter 2Algorithm 1 FIGURE 2.13 Step Operation 1Get values for NUMBER., Thoao and N,.N.00 Set the value of i to 1 and set the value of Found to NO While botdFound = NO)and (i 10,000) do Steps 4 through 7 If NUMBER is equal to the ith number on the list, T, then Print the name of the corresponding person, N Set the value of Found to YES Else (NUMBER is not equal to T) Add 1 to the value of i 7 8 If (found = NO)then Print the message Sis umber is not in the direc 10 Stop The sequential search algorithm (which is not actually a valid telephone number according to the North American Numbering Plan that covers the United States, Canada, and many Caribbean islands). In all likelihood, a communications company located in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!