After the first pass through the While loop, what are the values of Low and High? The
Question:
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", "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: 66% (12 reviews)
Lo...View the full answer
Answered By
JAPHETH KOGEI
Hi there. I'm here to assist you to score the highest marks on your assignments and homework. My areas of specialisation are:
Auditing, Financial Accounting, Macroeconomics, Monetary-economics, Business-administration, Advanced-accounting, Corporate Finance, Professional-accounting-ethics, Corporate governance, Financial-risk-analysis, Financial-budgeting, Corporate-social-responsibility, Statistics, Business management, logic, Critical thinking,
So, I look forward to helping you solve your academic problem.
I enjoy teaching and tutoring university and high school students. During my free time, I also read books on motivation, leadership, comedy, emotional intelligence, critical thinking, nature, human nature, innovation, persuasion, performance, negotiations, goals, power, time management, wealth, debates, sales, and finance. Additionally, I am a panellist on an FM radio program on Sunday mornings where we discuss current affairs.
I travel three times a year either to the USA, Europe and around Africa.
As a university student in the USA, I enjoyed interacting with people from different cultures and ethnic groups. Together with friends, we travelled widely in the USA and in Europe (UK, France, Denmark, Germany, Turkey, etc).
So, I look forward to tutoring you. I believe that it will be exciting to meet them.
3.00+
2+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
What are the values of (a) 12 8, (b) 35 / (7), (c) (24 8) (4 + 5), (d) (18 4) / (3 + 9 5), (e) (22/11) (18 + 3) / (12/4)?
-
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?
-
What are the two basic approaches used to perform a distributed route computation, and how does each work?
-
Find a and b if, y= ax+b has mean 6 and variance is unity, where x is a random variable with mean 8 and variance 16.
-
What are the purposes of a pleading?
-
Golden Ring Company produces two types of product: Large and Larger. Two work orders for two batches of the products are shown below, along with some additional cost information: Large Larger Work...
-
Why learn collaboration skills? LO.1
-
Bill and Edna had been married two years and had just reached the point where they had enough savings to start investing. Bills uncle Dave told them that he had recently inherited some very rare...
-
Exercise 11-4 (Algo) Payback period, unequal cash flows, and depreciation adjustment LO P1 A machine can be purchased for $120,000 and used for five years, yielding the following income. This income...
-
A pulse from a laser of power 1mW lasts for 10ns. If the number of photons emitted per second is 3.491 x 10, calculate the wavelength of the laser.
-
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...
-
On entering the While loop for the first time, what is the value of Index? The following pseudocode used to perform a binary search of the names "Arnold", "Draper", "Gomez", "Johnson", "Smith",...
-
In the book Bayesian Inference in Statistical Analysis (1973, John Wiley and Sons) by Box and Tiao, the total product yield for five samples was determined randomly selected from each of six randomly...
-
Lennys Limousine Service (LLS) is considering the purchase of two Hummer limousines. Various information about the proposed investment follows: Required: Help LLS evaluate this project by calculating...
-
Lancer Corp. has the following information available about a potential capital investment Required: 1. Calculate the projects net present value. 2. Without making any calculations, determine whether...
-
Woodchuck Corp. is considering the possibility of outsourcing the production of upholstered chair pads included with some of its wooden chairs. The company has received a bid from Padalong Co. to...
-
Woodchuck Corp. is considering eliminating a product from its line of outdoor tables. Two products, the Oak-A and Fiesta tables, have impressive sales. However, sales for the Studio model have been...
-
Suppose that Flyaway Company also produces the Windy model fan, which currently has a net loss of \($40,000\) as follows: Eliminating the Windy product line would eliminate \($20,000\) of direct...
-
Ask your instructor for the class mean and class standard deviation for one of the exams taken by your class. For that exam, calculate the z-score for your exam grade. How many standard deviations is...
-
Chapter 9 Stock Valuation at Ragan Engines Input area: Shares owned by each sibling Ragan EPS Dividend to each sibling Ragan ROE Ragan required return Blue Ribband Motors Corp. Bon Voyage Marine,...
-
What are the user data rates of STS-3, STS-9, and STS-12?
-
What is the purpose of the pointer in the line overhead?
-
Show how STS-9s can be multiplexed to create an STS-36. Is there any extra overhead involved in this type of multiplexing?
-
TB SA Qu. 13-74 (Static) What must Abdu invest today to... What must Abdu invest today to receive an annuity of $9,000 for four years semiannually at an 8% annual rate? All withdrawals will be made...
-
The tolal landed coet with the order gaantly sire of 6,000 unts is 4 (Enter your response roundod to the nearest dolar)
-
Boyne Inc. had beginning inventory of $12,000 at cost and $20,000 at retail. Net purchases were $120,000 at cost and $170,000 at retail. Net markups were $10,000, net markdowns were $7,000, and sales...
Study smarter with the SolutionInn App