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
kenny6666 [7]
1 year ago
10

what do we know about the contents of the arrays left and right with respect to what objects (integers) they contain in general

and the order of these objects in the arrays? g
Computers and Technology
1 answer:
KIM [24]1 year ago
3 0

A "divide and conquer" approach known as binary search necessitates sorting the starting array first. Because the technique divides the array into two equal halves, it is called a binary algorithm. A binary search will initially examine the middle item in the array and evaluate it in relation to the search terms.

<h3>What exactly is binary search?</h3>
  • Finding an element's location in a sorted array can be done using the searching method known as binary search.
  • With this method, an array's middle is always searched for the element. Only on a list of things that has been sorted can binary search be used. If the elements are not sorted already, we need to sort them first.
  • Binary search is used to find values in any sorted collection from any language library, including Java,.NET, C++ STL, etc.
  • A sorted array can be searched using the binary search algorithm by continually halving the search interval. Utilizing the knowledge that the array is sorted, binary search attempts to minimize the time complexity to O (Log n).

To Learn more about binary search refer:

brainly.com/question/21475482

#SPJ4

You might be interested in
What is control structure write it's types​ .
MAXImum [283]

Answer

<u>Defination</u><u>-</u><u>:</u>

A control statement is a statement and a statement whose execution its control.

<u>Types-:</u>

  • Selection Statement
  • Iteration Statement
  • Unconditional branching Statement
4 0
2 years ago
Find the max and min of a set of values using recursion Find the max and min of a set of values using recursion. First input the
matrenka [14]

Answer:

This question is answered using Python programming language

def MaxSet(mylist, count):  

     if (count == 1):  

           return mylist[0]  

     return max(mylist[count - 1], MaxSet(mylist, count - 1))  

def MinSet(mylist, count):  

     if (count == 1):  

           return mylist[0]  

     return min(mylist[count - 1], MinSet(mylist, count - 1))  

count = int(input("Length of set: "))

mylist = []  

for i in range(count):

     inp= int(input("Input: "))

     mylist.append(inp)

   

print("Minimum: "+str(MinSet(mylist, count)) )

print("Maximum: "+str(MaxSet(mylist, count)) )

Explanation:

This defines the recursion that returns the maximum

def MaxSet(mylist, count):  

This following checks for the maximum using recursion

<em>      if (count == 1):  </em>

<em>            return mylist[0]  </em>

<em>      return max(mylist[count - 1], MaxSet(mylist, count - 1))  </em>

This defines the recursion that returns the minimum

def MinSet(mylist, count):  

This following checks for the minimum using recursion

<em>      if (count == 1):  </em>

<em>            return mylist[0]  </em>

<em>      return min(mylist[count - 1], MinSet(mylist, count - 1))  </em>

The main begins here

This prompts user for length of set

count = int(input("Length of set: "))

This defines an empty list

mylist = []  

The following iteration gets user input

<em>for i in range(count): </em>

<em>      inp= int(input("Input: ")) </em>

<em>      mylist.append(inp) </em>

This calls the minimum function    

print("Minimum: "+str(MinSet(mylist, count)) )

This calls the maximum function

print("Maximum: "+str(MaxSet(mylist, count)) )

4 0
2 years ago
Race conditions are possible in many computer systems. Consider a banking system with two methods: deposit(amount) and withdraw(
Fittoniya [83]

Answer:

Race Condition is possible if husband and wife both have concurrent functionality.

Explanation:

For eg. if Balance = 3000 and husband withdraws = 1000 then remaining balance is = 2000.

One the other hand if balance is 3000 and wife deposits =1000 then remaining balance is 4000

we can see that there is inconsistency that is not acceptable.

To solve the problem mostly we are using Peterson's Algorithm

Account can be used for husband and wife,

int flag = 0

boolean account

1 :Husband

do{

account[i] =TRUE;

flag=(i+1)%2

while (account [(i+1)%2] && turn =(i+1)%2;

withdraw();

account[i] = FALSE

(remainder)

} While (TRUE);

This process can be repeat with (Wife)  where i will be replaced by j ,i=0 or 1 and j =1 or 0

  • flag identify which is going to access the bank account
  • account make sire that 2 users are mutually exclusive

Proved the race condition is prevented

4 0
3 years ago
Where else can the computer send the results of processing other than to output​
hjlf

Explanation:

it can also be sent through flashdrive

3 0
2 years ago
A circle surrounding the earth at the equator would consist of ___________ “degrees” of angular measurement.
Lelu [443]

Answer:

360°

Explanation:

Earth rotation can be defined as the amount of time taken by planet earth to complete its spinning movement on its axis.

This ultimately implies that, the rotation of earth refers to the time taken by earth to rotate once on its axis. One spinning movement of the earth on its axis takes approximately 24 hours to complete with respect to the Sun. Therefore, in a 24 hour period, the earth rotates 360 degrees about its axis and as such in an hour it rotates 15 degrees to create a 24-hours time zones.

When the earth's equatorial plane intersect with the surface of a celestial sphere, it results in the formation of a great circle which divides or cuts the earth into two equal halves known as celestial equator. This great circle divides the earth into a circumference having two (2) equal halves.

Hence, a circle surrounding the earth at the equator would consist of 360 “degrees” of angular measurement. Thus, giving rise to latitude (zones of latitude) which is north or south of the equator that includes equatorial, low latitude, mid latitude, tropical, subtropical and polar regions.

5 0
3 years ago
Other questions:
  • Information management examines the organizational resource of information and regulates its definitions, uses, value, and distr
    11·1 answer
  • What is the advantage of using Mail Merge Wizard when creating a mail merge?
    12·2 answers
  • Laura wants to know more about the organization to which she has applied. What can she do to know more about the organization’s
    12·1 answer
  • 2. Integer plot function (find a smart way to code big integers) Write a program BigInt(n) that displays an arbitrary positive i
    8·1 answer
  • We already know that we can create a lunar lander application of the pipe-and-filter architecture style from three independent J
    6·1 answer
  • Compute their Cartesian product, AxB of two lists. Each list has no more than 10 numbers.
    5·1 answer
  • Two types of formulas in Excel, what are they? A. Complex and simple, B. General and currency, C. Logical and Boolean, D. Trig a
    15·1 answer
  • Which properties would be useful to know to search for a Word document? Check all that apply.
    7·1 answer
  • 9. Lael wants to determine several totals and averages for active students. In cell Q8, enter a formula using the COUNTIF functi
    9·1 answer
  • The principle of ________ strongly suggests that programs should execute with the least amount of privileges needed to complete
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!