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 could social media have a negative impact if not used properly when seeking employment
castortr0y [4]
Before hiring someone, employers often check the social media pages of people applying for a job. If their social media account has content not up to the company's standards, they may not get the job. 
8 0
3 years ago
Which type of chart is used to chart progress over time?
Morgarella [4.7K]

Answer: Timeline

Explanation:

6 0
2 years ago
Question 4
Tcecarenko [31]

Answer: squared ← number * number

Explanation:

4 0
3 years ago
Remember that kid who would always ask you for your food, even though he packed his own lunch.
Verizon [17]

Answer:

ye ye

Explanation:

7 0
2 years ago
Read 2 more answers
Zach follows the instructions that show him how to create a custom Web site in his school's learning management system. These st
NNADVOKAT [17]

Answer:

The answer is "Procedure"

Explanation:

In the given statement certain information is missing, that is choices, which can be described as follows:

a. procedure

b. software

c. data

d. hardware

e. memory

The procedure is a way, that accomplishes any task in the following steps, if there is a long process so, we divide this process into parts or modules to accomplish the task, and  certain alternative was wrong, that can be described as  follows:

  • Software is a program, that is accomplished in the procedure.
  • data, It describes all procedures.
  • hardware, It is a device, in which we work.
  • memory, It stores all the data in a procedure.    
3 0
2 years ago
Other questions:
  • How do i unblock website on my school computer
    7·2 answers
  • About.com is considered a (an):
    6·1 answer
  • How does Frankenstein feel about his creation?
    15·1 answer
  • Which party controlled the White House and politics in the late 1800s, except for Grover
    6·2 answers
  • Give an example of a situation in which a compromise of Confidentiality leads to compromise in Integrity.Situation where confide
    8·1 answer
  • What option for deploying software to users provides a link to install an application within Control Panel's Programs and Featur
    6·1 answer
  • You're the sole IT employee at your company, and you don't know how many users or computers are in your organization. Uh oh! Wha
    8·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    13·1 answer
  • Please choose the correct option please tell fast​
    9·1 answer
  • Choose the correct answer
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!