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
vlada-n [284]
2 years ago
6

Identify what algorithm or concept the following code relates to. void Sort(int array[], int tempArray[], int left, int right) {

int i, j, k, middle; if(right > left) { middle
Computers and Technology
1 answer:
galina1969 [7]2 years ago
4 0

Answer:

Binary sort

Explanation:

Binary sort is one of the fastest search techniques used on arrays and other iterable data types. It algorithm sorts the array in ascending order then gets the item in the middle from which it divides the array to be searched in two parts. If the searched term is less than the mid item, then it is searched for in the first part, else it would be in the second.

You might be interested in
Give a big-O estimate for the number additions used in this segment of an algorithm.
rjkz [21]
Big-O notation is a way to describe a function that represents the n amount of times a program/function needs to be executed. 

(I'm assuming that := is a typo and you mean just =, by the way) 

In your case, you have two loops, nested within each other, and both loop to n (inclusive, meaning, that you loop for when i or j is equal to n), and both loops iterate by 1 each loop.

This means that both loops will therefore execute an n amount of times. Now, if the loops were NOT nested, our big-O would be O(2n), because 2 loops would run an n amount of times.

HOWEVER, since the j-loop is nested within i-loop, the j-loop executes every time the i-loop <span>ITERATES. 
</span>
As previously mentioned, for every i-loop, there would be an n amount of executions. So if the i-loop is called an n amount of times by the j loop (which executes n times), the big-O notation would be O(n*n), or O(n^2). 

(tl;dr) In basic, it is O(n^2) because the loops are nested, meaning that the i-loop would be called n times, and for each iteration, it would call the j-loop n times, resulting in n*n runs.

A way to verify this is to write and test program the above. I sometimes find it easier to wrap my head around concepts after testing them myself.
3 0
3 years ago
Which options most accurately describe the information that should be included in note-taking? SELECT ALL THAT APPLY
velikii [3]
I think: B,C,D. You do not need to write notes on a thing that you will only see, but you need a date, key words, and main ideas.
4 0
3 years ago
Read 2 more answers
Which software application would you use to calculate and manipulate numerical data?
Basile [38]
The Software App That I Would Use Would Be NumericalDataHelp.com ... I Use that all the time ... If you cant find it just search in Google or Firefox Numerical Data Help and then you should be able to find some help there ... I hope that this helped !!! If it did mark me brainiest 
5 0
3 years ago
How do I get to a file?
Damm [24]

Answer:

You go to the "files" in your computer

It also depends on what kind of computer/laptop u have

Explanation:

3 0
3 years ago
What is the answer ?? plz help
Morgarella [4.7K]
3rd: A force applied to a body to propel it in a desired direction.
5 0
2 years ago
Other questions:
  • Information Governance (IG) consists of? A. the overarching policies and processes to optimize and leverage information while ke
    7·1 answer
  • What uses HTML hypertext links that users can click to access different locations or information?
    11·1 answer
  • The expression 10,785(1.0275)x represents the amount of money in an investment account with interest that compounds annually for
    14·2 answers
  • Computer is created by aliens?!
    14·1 answer
  • ? Assessment
    12·1 answer
  • The computerization of the layout and paste-up process further complicated printing, as did the digitizing of photographs.
    12·1 answer
  • Describe the dynamic Network Address Translation (NAT).
    9·1 answer
  • Write a complete Java program called Stewie2 that prints the following output. Use at least one static method besides main. ////
    9·2 answers
  • Questions about the data policy and privacy policy of YT
    13·1 answer
  • Which way do you swipe in ios to get to the control center
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!