1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kykrilka [37]
3 years ago
13

From the binary search algorithm, it follows that every iteration of the while loop cuts the size of the search list by half.

Computers and Technology
1 answer:
Colt1911 [192]3 years ago
6 0

Answer:

True: In binary search algorithm, we follow the below steps sequentially:

Input: A sorted array  B[1,2,...n] of n items and one item x to be searched.

Output: The index of x in B if exists in B, 0 otherwise.

  1. low=1
  2. high=n
  3. while( low < high )
  4.  {      mid=low + (high-low)/2
  5.         if( B[mid]==x)
  6.          {
  7.             return(mid)  //returns mid as the index of x
  8.           }
  9.          else
  10.          {
  11.              if( B[mid] < x)      //takes only right half of the array
  12.               {
  13.                 low=mid+1
  14.               }
  15.              else               // takes only the left half of the array
  16.               {
  17.                high=mid-1
  18.               }
  19.           }
  20.  }
  21. return( 0 )

Explanation:

For each iteration the line number 11 or line number 15 will be executed.

Both lines, cut the array size to half of it and takes as the input for next iteration.

You might be interested in
How many answers do you need to be able to write messages on here??
Kipish [7]

1,000

Hope this helps!



~Courtney

3 0
3 years ago
Type size in a textbook may be used to indicate the relative importance of ideas.
Alborosie
Yes true 

hey is this one of your questions on a science packet if so it is called explore ring Earth's surface because I have the same packet with the same question on it
3 0
3 years ago
Read 2 more answers
Which of the following software is cloud-based? OpenOffice Writer Word 2013 Word Online Word Perfect\
evablogger [386]
I think its open office
3 0
3 years ago
Read 2 more answers
Please identify three examples of how the United States is heteronormative
juin [17]

Answer:

Well, let's say you're out at a bar. A friend of yours sees a cute guy, but she's hesitant to make the first move because she assumes the guy would be turned off by that - because we're socialized to believe that women shouldn't approach men like that, lest they come off as desperate. That's heteronormativity.

When she finally gets the courage to go up and talk to him, he begins to call her infantilizing pet names (like honey, baby, and sweetheart) - which would be fine if they'd agreed upon it, but he's just assuming she's cool with it! That's heteronormativity.

When she begins to get uncomfortable by these names, she gets up and leaves. But the guy says something like, "Oh, come on! Women are so sensitive. What's your problem?" That's heteronormativity.

5 0
3 years ago
What is objective reporting?
stira [4]
Objective reporting is reporting that separates facts and opinion.
7 0
3 years ago
Other questions:
  • Playville is a tiny town in fictional middle earth, which is inhabited by dwarves and elves. Playville has a playground to which
    6·1 answer
  • When writing test methods, what functionality is verified by the system method "runAs()"?
    7·1 answer
  • Jason is creating a webpage on the basic parts of a camera. He has to use a mix of both images and content for the web page to h
    11·1 answer
  • Which of the following has likely attended vocational school?
    10·1 answer
  • \Read the sentence.
    12·1 answer
  • Persuasion is when Someone speaks to crowd about love <br>○True<br>○False​
    10·1 answer
  • Elsa wants to save her work at the office to be continued at home either on a pen drive or CD. Outline three reasons why she wil
    6·1 answer
  • What is a common translator?​
    9·1 answer
  • Who is the father of computer?​
    14·1 answer
  • Write about virus in five points.​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!