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
jenyasd209 [6]
3 years ago
13

Write down a recurrence relation for this version of QuickSort, and solve it asymp-totically. Show your work. Assume that the ti

me it takes to find the pivot (eitherbest or worst, depending on the level of recursion) is Θ(n) for lists of lengthn.
Computers and Technology
1 answer:
torisob [31]3 years ago
5 0

Answer:As in merge sort, the time for a given recursive call on an n-element subarray is Θ(n). In merge sort, that was the time for merging, but in quicksort it's the time for partitioning.

Explanation:

Worst-case running time:

When quicksort always has the most unbalanced partitions possible, then the original call takes cncnc, n time for some constant ccc, the recursive call on n-1n−1n, minus, 1 elements takes c(n-1)c(n−1)c, left parenthesis, n, minus, 1, right parenthesis time, the recursive call on n-2n−2n, minus, 2 elements takes c(n-2)c(n−2)c, left parenthesis, n, minus, 2, right parenthesis time, and so on. cn+c(n−1)+c(n−2)+⋯+2c=c(n+(n−1)+(n−2)+⋯+2)

=c((n+1)(n/2)−1)

The last line is because 1 + 2 + 3 +...... n is the arithmetic series

Best-case running time:

Quicksort's best case occurs when the partitions are as evenly balanced as possible: their sizes either are equal or are within 1 of each other. The former case occurs if the subarray has an odd number of elements and the pivot is right in the middle after partitioning, and each partition has (n-1)/ 2 elements. The latter case occurs if the subarray has an even number n of elements and one partition has n/2 elements with the other having n/2-1.In either of these cases, each partition has at most n/2 elements.

Using big-Θ notation, we get the same result as for merge sort: Θ(nlog2n)

You might be interested in
What does the "configure dhcp options for proxy dhcp" option do?
ZanzabumX [31]
You should select the configure DHCP options for proxy DHCP option if the local DHCP server is a Microsoft DHCP server, if you select this option the DHCP server is automatically configured to forward the PXE requests to the WDS server. If the local DHCP server is not a Microsoft DHCP server, you have to configure the DHCP server manually to forward the request to the WDS server. 
5 0
3 years ago
Tom only thinks about his own gain and does not care about the team objectives. What quality is he demonstrating? A. resourceful
Grace [21]

Answer:

D. Selfishness

Explanation:

Selfishness is caring about yourself and not others

8 0
3 years ago
What is the best definition of the 7x7 rule for maximizing audience comprehension
olganol [36]

The 7x7 Rule states that a PowerPoint slide should have no more than seven lines of text and no more than seven words in each of those lines.

7 0
3 years ago
In addition to good design sense, what else do web designers need to be proficient in?
ELEN [110]

In addition to good design sense, web designers need to be proficient in front-end coding languages.

A web designer refers to an individual who is saddled with the responsibility of writing executable codes (instructions) for the design and development of a website, especially by using a hypertext markup language (HTML).

Generally, it is expected that all web designers a good design sense in website development. Additionally, web designers need to be proficient in front-end coding languages, so as to ensure the graphical display and user-interface (UI/UX) are attractive and properly rendered.

Some examples of front-end coding languages include:

  • CSS
  • HTML
  • Javascript
  • React
  • JQuerry
  • Vue

Read more on web design here: brainly.com/question/8391970

7 0
2 years ago
Hardware refers to programs and protocols used on a computer system.<br><br> True<br> False
lapo4ka [179]

Answer:

False

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • When purchasing a(n) ________ computer, having cellular as well as wifi can be important?
    9·1 answer
  • *****NEED HELP ASAP!!!! COMPUTER HELP!!!! PLEASE!**
    13·1 answer
  • Which topology enables only one person, at one time, to send data to others on the network?
    6·1 answer
  • A financially stable person is able to
    12·2 answers
  • Digital libraries are often available to students and/or employees at colleges, schools, and BLANK institutions.
    15·1 answer
  • It is always better to run over and give more information when you are giving a presentation versus quitting on time. true false
    15·2 answers
  • Which of the following is a name for the place an information services and support professional might work? software development
    15·2 answers
  • I will mark brainliest
    9·1 answer
  • Match the desired outcome to the appropriate action.
    6·1 answer
  • Sistem komponen mekanikal yang terdapat pada sebuah basikal?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!