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]
4 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]4 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
What should you always do to clean off tables
ikadub [295]
Wipe then off then spray them down then wipe off again
7 0
3 years ago
Read 2 more answers
Free points i got the answer
GaryK [48]

Answer:

thanks for the free points

6 0
3 years ago
Read 2 more answers
4. How many times will the print statement be executed within the following nested for loops? Briefly explain how or show the ma
HACTEHA [7]

Print statements are used to display outputs

The number of times the nested loop will be executed is 43200

<h3>What are nested for loops?</h3>

Nested for loops are loops that are placed within another loop or loops

From the statement, we have the following loop conditions:

h = 1; h <= 12, m = 0; m <= 59 and s = 0; s <= 59

The above means that:

  • h = 12 --- the outer loop will be executed 12 times
  • m = 60 --- the middle loop will be executed 60 times
  • s = 60 --- the inner loop will be executed 60 times

So, the number of times the nested loop will be executed is:

Count = 12*60 *60

Count = 43200

Hence, the number of times the nested loop will be executed is 43200

Read more about loops at:

brainly.com/question/14284157

8 0
3 years ago
Zahid needs to ensure that the text flows around an image instead of the image being placed on a separate line as the text. Whic
erica [24]

Answer:

I believe the answer is He can't do this on the layout dialog box

Explanation:

You use the format tab for text wrapping.

( Sorry if I'm wrong )

7 0
3 years ago
Read 2 more answers
You have been given an encrypted copy of the Final exam study guide here, but how do you decrypt and read it???
Agata [3.3K]

Answer:

You use a decoder

Explanation:

You can find one on an internet browser

7 0
3 years ago
Other questions:
  • Categorize the following relationships into generalization, aggregation, or association. Beware, there may be n-ary associations
    14·1 answer
  • "Which of the following will help protect against a brute force attack?
    11·1 answer
  • Weber believed that there is an inevitable destructive quality to which one of the four types of action?
    8·1 answer
  • In 1-2 sentences describe how to use the thesaurus in the Word Processor
    11·2 answers
  • The ____ category of apps makes the computer easier for blind people to use.
    9·1 answer
  • ________ enables advertisers to display more relevant ads based on user's search and browsing history. FIP NORA A Web bug An int
    10·1 answer
  • Name the different types of constructors that a designer can provide in a class. Provide an example with a class showing many co
    15·1 answer
  • Write a program that gets three input characters which are user's initials and displays them in a welcoming message. Then gets i
    12·1 answer
  • What facilitates the automation and management of business processes and controls the movement of work through the business proc
    9·1 answer
  • What is the optimal number of members for an Agile team?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!