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
babunello [35]
3 years ago
6

For the binarySearch method in Section 7.10.2, what is low and high after the first iteration of the while loop when invoking bi

narySearch(new int[]{1, 4, 6, 8, 10, 15, 20}, 11)?A. low is 0 and high is 6B. low is 5 and high is 5C. low is 3 and high is 6D. low is 4 and high is 6E. low is 6 and high is 5
Computers and Technology
1 answer:
Marat540 [252]3 years ago
4 0

Answer:

Answer D : Low is 4 and high is 6

Explanation:

Here is Function

int binarySearch(int arr[], int l, int r, int x)  {

 while (l <= r) {  

       int m = l + (r - l) / 2;  

  // Check if x is present at mid  

       if (arr[m] == x)  

           return m;  

  // If x greater, ignore left half  

       if (arr[m] < x)  

           l = m + 1;  

  // If x is smaller, ignore right half  

       else

           r = m - 1;   }  

    // if we reach here, then element was  

   // not present  

   return -1; }

You might be interested in
The main trade-off that all investors must consider is
Talja [164]
<span>The main trade-off that all investors must consider is Risk vs Return
In the end, all the techniques that implemented in investing process is aimed for nothing other than profit.
Current market trend dictates that potential return tend to be higher the riskier the investment is and vice versa.
</span>
3 0
4 years ago
Read 2 more answers
Traceability of requirements is helpful in the followingexcept
larisa86 [58]

Answer: D)  Identifying GUI's for a particular requirement

Explanation:

 Traceability of requirements is helpful except identifying GUI's for a particular requirements as, traceability in project management describe the relationships between two or more element throughout in the development process and outline the relationship between the customer requirement by traceability matrix. And the requirement of traceability is so important because it creating a downstream flow of software and test cases in software requirement but not helpful in GUI identification.

6 0
4 years ago
When creating a firewall exception, what is the difference between opening a port and allowing an application through?
Mnenie [13.5K]
Every application has access to specific opened port. If you only make a exception for the specific application only that application can bypass the firewall.
6 0
4 years ago
The feedforward part of the conversation should do all of the following except __________.a.identify the toneb.introduce the pur
polet [3.4K]

Answer:

give leave taking clues

Explanation:

The feed forward part of the conversation should do all of the following except <u>give leave taking clues</u> a identify the tone introduce the purpose give leave-taking clues establish a time-frame

3 0
4 years ago
6 + 7 = 7 + 6 is an example of which property of addition?
Sauron [17]

Answer:

commutative

Explanation:

The commutative property states that the numbers on which we operate can be moved or swapped from their position without making any difference to the answer.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Does a soda vending machine Give reciepts?<br><br>need for computer science hw
    7·2 answers
  • A user reports his or her computer is slow to boot. You check the boot order and determine that the computer is checking the C d
    12·1 answer
  • Is a plotter input output or both
    10·1 answer
  • Consider the formula: G=D+(A+C^2)*E/(D+B)^3 Show the order that a processor would follow to calculate G. To do so, break down th
    10·1 answer
  • True or False: It is illegal to park in a location that you block or create a hazard for other vehicles.
    11·2 answers
  • What is an advantage of a computer network ? networked
    13·2 answers
  • Which CIDR network has the smallest possible number of hosts? a. 123.0.0.0/8 b. 123.45.0.0/16 c. 123.45.67.0/24 d. All have the
    10·1 answer
  • What is considered appropriate dress for men and women in the workplace? Select all that apply.
    6·2 answers
  • What would a system unit that is integrated with the display and keyboard would be considered?
    6·1 answer
  • Which example illustrates the idea of "collecting data"?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!