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
A=1/2h(a+b) solve for h
devlian [24]

A=1/2h(a+b)

1/2 can be said as 0.5

so

A=0.5h(a+b)

0.5h is being multiplied with (a+b), taking this expression of left hand side gives

A/0.5(a+b)=h

OR

h=A/0.5(a+b)

This is the final answer

8 0
3 years ago
________ software provides a means of sharing, distributing, and searching through documents by converting them into a format th
Alexus [3.1K]
The answer to this question is Document Management Software.

Document Management Software or DMS is a computer system or software that is used to store, share, manage, and distribute documents by converting paper based documents into an electronic image that can be viewed by any user. The converting of documents is through the use of a scanner, and the document management software will enable the users to manage the electronic documents or data.
3 0
3 years ago
What is looping in QBASIC​
Elden [556K]

A looping is a set of instructions which is repeated a certain number of times until a condition is met. hlo dai k xa halkhabar

3 0
3 years ago
in the topology configuration, hosts are connected to each other through a central controller which assumes all responsibility f
Colt1911 [192]

in the <u>star</u> topology configuration, hosts are connected to each other through a central controller which assumes all responsibility for routing messages to the appropriate host.

Define topology.

When a geometric object <u>is stretched, twisted, crumpled, or bent without closing or opening holes, ripping, gluing, or passing through itself, certain features are kept</u>. This is known as topology in mathematics.

<u>The study of datasets using </u><u>topological </u><u>methods</u> is known as topological-based data analysis (TDA) in applied mathematics. <u>Open sets are a convenient way to define the basic </u><u>topological </u><u>notions of continuity, compactness, and connectedness</u>.

To learn more about topology, use the link given
brainly.com/question/14560531
#SPJ4

3 0
1 year ago
Object-oriented systems have three general types of cohesion: _____, _____, and _____. A. method, class, inheritance B. method,
Verdich [7]

Answer:

D. method, class, generalization/specialization

Explanation:

The Cohesion is said to be the level to what an element of a module is related to others. Generally, the cohesion can be understood as an internal adhesive that holds together the modules. If the software is good then it is going to have high cohesion. Method and class are type of cohesion, as they hold the modules together. And generalization/specialization also is a general type of cohesion as generalization tracks the common features among the class, and binds them into one superclass. However, the specialization means creating subclasses out of the classes, and which is the meaning of the specialization. In an ideal situation, there should be high cohesion or single responsibility. However, in the case of inheritance, there can be multiple responsibilities. And hence composition like a generalization, specialization, association, aggregation are used to make use of the composition for reuse rather than inheritance. Have you seen language supporting multiple inheritances. You will never see it though there is some way. And its never allowed to ensure high cohesion. And hence three general types of cohesion are method, class and generalization/specialization. And this is option D.

4 0
3 years ago
Other questions:
  • you install teamviewer on your workstation at home so that you can ac ess it when on the road. how can you be assured that unkno
    9·1 answer
  • 20 Points!! Please hurry!!
    9·1 answer
  • A network security analyst received an alert about a potential malware threat on a user’s computer. What can the analyst review
    12·1 answer
  • Thomas has signed a deal with a production house that allows them to use his images on their website. What is required when imag
    5·2 answers
  • E-What is the important of Recycle bin?<br>Ans:​
    12·1 answer
  • Class C Airspace inner ring begins at the __________ and extends vertically (by definition) to MSL charted values that generally
    5·1 answer
  • PLEASE HELP ME!!! I REALLY NEED YOU TO HELP ME NOW!!!! THANKS!
    6·1 answer
  • Where would you go to access frequently used icons?
    12·2 answers
  • I need help now with YT
    7·2 answers
  • A text that presents an event and describe what happens as a result is an example of what text structure
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!