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
NNADVOKAT [17]
3 years ago
7

If a binary search is applied to an array with 1024 elements, in the worst case, the main loop executes, approximately, _____.

Computers and Technology
1 answer:
trasher [3.6K]3 years ago
7 0

Answer:

10.

Explanation:

Binary search divides the array to be search each in half according to the value of the element.

The worst case time complexity of binary search is O(logN).

In this case the time complexity will come out to be log₂(1024)=10.

So the binary search can divide this array in half maximum of 10 times.

Hence the main loop will executes 10 times.

You might be interested in
Free brainliest!?! <3​
Sholpan [36]

Meee plzzzzz First!............

4 0
2 years ago
Read 2 more answers
Although the first GPS satellite was put into orbit in the ___________, GPS did not provide global coverage until _______.
Ilia_Sergeevich [38]
February 22 1978 and 1992 
5 0
3 years ago
Write a program that prompts the user to input a number. The program should then output the number and a message saying whether
Gala2k [10]

Answer:

Following is the program in C++ Language

#include <iostream> // header file

using namespace std; // namespace std

int main() // main method

{

   int n;  // variable declaration

   cout<<" Please enter the number :";

   cin>>n; // Read the number

   if(n>0) // check the condition when number is positive

   {

cout<<n<<endl<<"The number is Positive"; // Display number

   }

  else if(n<0) // check the condition when number is Negative

  {

cout<<n<<endl<<"The number is Negative";// Display number

  }

  else // check the condition when number is Zero

  {

cout<<n<<endl<<"The number is Zero";// Display number

  }

   return 0;

  }

Output:

Please enter the number:

64

The number is Positive

Explanation:

Following are the description of the program

  • Declared a variable "n" of int type.
  • Read the value of "n" by user.
  • Check the condition of positive number by using if block statement .If n>0 it print the number is positive.
  • Check the condition of negative number by using else if block statement If n<0 it print the number is negative.
  • Finally if both the above condition is fail it print the message " The number is Zero"

7 0
3 years ago
What are some tasks Petroleum Engineers perform?
tresset_1 [31]
They mostly revolve of production of gas and oil.When a new reservoir is located,the engineers analyze it to determine if it can be exploited with profit.If so they create a drilling and extraction plan to pump out gas or oil as little as possible.
5 0
3 years ago
Read 2 more answers
System where energy is used to move people is a what system
Travka [436]

Energy is not consumed by motion. And since motion is relative, that means the amount of energy is relative to reference frame.
4 0
2 years ago
Other questions:
  • If you don't know whether to write too, two, or to, you should use the spell-checker to help you decide. true or false?
    7·1 answer
  • Given that the time to read data off a 7200 rpm disk drive will be roughly 75% of a 5400 rpm disk, at what idle time of the 7200
    13·1 answer
  • Climate is considered a(n) _______ limiting factor. (2 points)
    9·1 answer
  • Samantha was calculating a mathematical formula on an electronic spreadsheet. She used multiple values to recalculate the formul
    8·2 answers
  • 3. The invention of the transistor was important to the development of computers because it
    5·1 answer
  • Write a program that asks the user to input
    11·1 answer
  • Irene wants to connect your smart phone wirelessly to her laptop in order to transfer images. which two images could she reasona
    15·1 answer
  • State five differences between Dos and Windows.​
    14·1 answer
  • Que es una red de datos
    7·2 answers
  • When was the first analog device, the phonautograph, launched?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!