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?
-
The GDP for the United States is $18,036 billion and its current account balance is $484 billion. What percent of GDP is the current account balance?
-
Prove that for a European Call option on an asset that pays no dividends the following relations hold: \[C \leq S, \quad C \geq S-E \exp (-r(T-t))\]
-
Water is to be pumped from a lake to a ranger station on the side of a mountain (see figure). The flow rate is to be 95gal/mm, and the flow channel is a standard 1-in. Schedule 40 steel pipe (ID =...
-
COMPLETE PART B AND USE NEWTON RAPHSON ITERATION METHOD SO SOLVE WHAT IS a and b. The answer should be 0.79 and 0.19 ish Question 1 Box-shaped design are commonly seen for small satellites. The...
-
So the project involves more than simply performing maintenance work on the current programs, Chip says. Are we using a formal methodology for analyzing and designing the new system? Yes, replies...
-
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",...
-
Let y be a random variable having a normal distribution with a mean equal to 250 and a standard deviation equal to 50. Find the following probabilities: a. P(y > 250) b. P(y > 150) c. P(150 < y <...
-
Which of the following statements is correct? a. Prepaid Expenses are decreased with a debit. b. Unearned Revenue is increased with a debit. c. Rent Expense is increased with a credit. d. Accounts...
-
Sedlor Properties purchased office supplies on account for $800. Which journal entry records the payment on account of those office supplies? Date a. b. C. d. Accounts Payable Accounts and...
-
The journal entry for the purchase of inventory on account using the perpetual inventory system is Date a. Merchandise Inventory Accounts Receivable Accounts and Explanation b. Accounts Payable C....
-
Get Fit Now gains a client who prepays $540 for a package of six physical training sessions. Get Fit Now collects the $540 in advance and will provide the training later. After four training...
-
Which of the following accounts may appear on a post-closing trial balance? a. Cash, Salaries Payable, and Retained Earnings b. Cash, Salaries Payable, and Service Revenue c. Cash, Service Revenue,...
-
Stenbeck Chemical has spent $244,000 to refine 71,000 gallons of acetone, which can be sold for $2.00 a gallon. Alternatively, Stenbeck Chemical can process the acetone further. This processing will...
-
Stephen Schor, an accountant in New York City, advised his client, Andre Romanelli, Inc., to open an account at J. P. Morgan Chase Bank, N.A., to obtain a favorable interest rate on a line of credit....
-
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?
-
STS plc collects waste from houses, offices and factories. Most of the waste is burned to produce heat and electricity for the companys own use. This saves costs and reduces the impact on the...
-
Scenario You are the CFO of a Catholic School. You are asked to present recommendations to the board on two issues facing the school: First, the administration is considering purchasing a gymnasium...
-
A company projects an increase in net income of $30,000 each year for the next five years if it invests $300,000 in new equipment. The equipment has a five-year life and an estimated salvage value of...
Study smarter with the SolutionInn App