Question: E Chapter 2, Problem 13E Bokmark Show all steps Modify the sequential search algorithm of Figure 2.13 so that it works correctly even if the

 E Chapter 2, Problem 13E Bokmark Show all steps Modify the

E Chapter 2, Problem 13E Bokmark Show all steps Modify the sequential search algorithm of Figure 2.13 so that it works correctly even if the numbers in the reverse directory are not unique, that is, if the desired number occurs more than once. (For example, a single number may be listed separately under the husband's name and the wife's name.) Your modified algorithm should find every occurrence of NUMBER in the directory and print the name corresponding to every match. In addition, after all the names have been displayed, your algorithm should print how many occurrences were located. For example, if NUMBER occurred twice, the output of the algorithm might look something like this: Susan Doe John Doe A total of two occurrences were located Figure 2.13 Step Operation 1 Get values for NLIMBER TT and N Set the value of ito 1 and set the value of Faund to NO Pint the name of the conesponding pason, N Ese ONUMBER is not equal to T Add 1 to the value of i Print the message Somy, this number is not in the dinectory The sequential search algorithm e here to search 96 8 3 4 5 6

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!