How many passes are made through the While loop? The following pseudocode used to perform a binary
Question:
How many passes are made through the While loop?
The following pseudocode used to perform a binary search of the names "Arnold", "Draper", "Gomez", "Johnson", "Smith", "Wong" (stored in Array), for the name "Gomez". (Assume the array and all the variables have already been declared with their appropriate data types.)
Transcribed Image Text:
Set N = 5 Set Key "Gomez" Set Low Set High = N Set Index Int (N/2) Set Found While (Found == 0) AND (Low <= High) If Key Array [Index] Then %3D%3D Set Found = 1 End If If Key > Array[Index] Then Set Low = Index + 1 Set Index = Int((High + Low)/2) End If If Key < Array[Index] Then Set High = Index - 1 Set Index = Int((High + Low)/2) End If End While
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 85% (7 reviews)
Answered By
Nazrin Ziad
I am a post graduate in Zoology with specialization in Entomology.I also have a Bachelor degree in Education.I posess more than 10 years of teaching as well as tutoring experience.I have done a project on histopathological analysis on alcohol treated liver of Albino Mice.
I can deal with every field under Biology from basic to advanced level.I can also guide you for your project works related to biological subjects other than tutoring.You can also seek my help for cracking competitive exams with biology as one of the subjects.
3.30+
2+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
How many passes are made through the outer For loop? The following pseudocode, which is used to perform a selection sort in ascending order on the names "Wong", "Smith", "Johnson", "Gomez", "Draper",...
-
The Wilcoxon signed-rank test can be used to perform a hypothesis test for a population median, , as well as for a population mean, . Why is that so?
-
Which group function can be used to perform a count that includes NULL values?
-
The manufactured wood beam carries a uniformly distributed load of in- tensity wo. Determine the largest safe value of wo if the maximum shear stress in the wood is limited to 300 psi. 1.0 ft Wo 4 ft...
-
What are the four basic elements that must be contained in the complaint?
-
Why does the trade balance and the current account balance track so closely together over time?
-
Given the formulation of the free boundary problem for the valuation of an American Put option, \[\begin{aligned}& \frac{\partial P}{\partial t}+\frac{1}{2} \sigma^{2} S^{2} \frac{\partial^{2}...
-
The Home and Garden (HG) chain of superstores imports decorative planters from Italy. Weekly demand for planters averages 1,500 with a standard deviation of 800. Each planter costs $ 10. HG incurs a...
-
As of December 31, 2014, Toyota company: had assets of 13,050,000, liabilities of 4,650,000, share capital of 3,300,000 and retained earnings of 5,100,000. What is the Total equity as of that date?
-
There is a lottery with n coupons and n people take part in it. Each person picks exactly one coupon. Coupons are numbered consecutively from 1 to n, n being the maximum ticket number. The winner of...
-
After the While loop is exited, what is the value of Found? The following pseudocode used to perform a binary search of the names "Arnold", "Draper", "Gomez", "Johnson", "Smith", "Wong" (stored in...
-
After the first pass through the While loop, what are the values of Low and High? The following pseudocode used to perform a binary search of the names "Arnold", "Draper", "Gomez", "Johnson",...
-
Now that Jennifer is in middle school, her parents have decided that they really must start saving for her college education. They have $10,000 to invest right now. Furthermore, they plan to save...
-
Tiny Town Kennel earns service revenue by caring for the pets of customers. Tiny Town Kennel is organized as a corporation. During the past month, Tiny Town Kennel has the following transactions: a....
-
Assume that the weekly payroll of In the Woods Camping Supplies is $300. December 31, end of the year, falls on Tuesday, and In the Woods will pay its employee on Friday for the full week. What...
-
JC Manufacturing purchased inventory for $5,300 and also paid a $260 freight bill. JC Manufacturing returned 45% of the goods to the seller and later took a 2% purchase discount. Assume JC...
-
Assume Juniper Natural Dyes made Net Sales Revenue of $90,000 and Cost of Goods Sold totaled $58,000. What was Juniper Natural Dyes gross profit percentage for this period? (Round your answer to the...
-
Movies Online sells subscriptions for $36 for 18 months. The company collects cash in advance and then subscribers have access to unlimited movies each month. Apply the revenue recognition principle...
-
AI Banking provides banks web access to sophisticated financial information and analysis systems. The company combines these tools with benchmarking data access, including e-mail and wireless...
-
Explain the buyers position in a typical negotiation for a business. Explain the sellers position. What tips would you offer a buyer about to begin negotiating the purchase of a business?
-
How is an STS multiplexer different from an add/drop multiplexer since both can add signals together?
-
What type of topology is used when customers in an area use DSL modems for data transfer purposes? Explain.
-
What is the relationship between STS signals and OC signals?
-
United States Mexico Tank 1 hour 2 hours Taco 1 minute 1.5 minutes a. Who has the absolute advantage in tank production? Taco production? b. Who has the comparative advantage in tank production? Taco...
-
13) A local business owner is considering adding another employee to his staff in an effort to increase the number of hours the store is open per day. a. If the employee will cost the owner $4,000...
-
The standard variable overhead rate for Unbeatable Toys is $5. Budgeted fixed overhead is $20,000. Unbeatable Toys' budgeted production was 2,000 units for the current period and actual production...
Study smarter with the SolutionInn App