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
alex41 [277]
3 years ago
11

The height of a treap depends on the random priority. However, the probability distribution of the height of an treap is exactly

the same as the probability distribution of the number of rounds in a quicksort algorithm, as long as we choose pivots in the quicksort uniformly at random. Please prove this.
Mathematics
1 answer:
Ugo [173]3 years ago
4 0

Answer:

Step-by-step explanation:

Heap Property: The associated priority satisfy the heap property. The (max) heap property requires for every node that the priority at a node is greater than the priority of its two children.

THEOREM: For any set S of key-value pairs, there is exactly one treap T containing the key-value

pairs in S which satisfies the treap properties.

Proof: The key k with the highest priority in S must be the root node, since otherwise the tree would not be in heap order. Then, to satisfy the property that the treap is ordered with respect to the nodes’ keys, all keys in S less than k must be in the left subtree, and all keys greater than k must be in the right subtree. Inductively, the two subtrees of k must be constructed in the same manner.

Now, if you are given a set of elements with keys and priorities, how would you build a treap

out of them? Take the element with the largest priority, make that the root. Then partition around

that root based on keys to find the elements in the right and left subtrees and recurse. What does

this remind you of?

This procedure is exactly the procedure you do for quicksort. There is a straightforward relationship between the analysis of quicksort and the height of a treap

You might be interested in
13. Diego wants to purchase a used car that sells for $6,399. The dealer has offered him $299 on his trade-in car. The total cos
laila [671]

Answer:

$6100

Step-by-step explanation:

6,399 - 299 = $6100

8 0
3 years ago
9 rubber stamps cost $8.64<br><br> Which equation would help determine the cost of 88 rubber stamps?
EleoNora [17]
You need to multipy 8.64 and 9

7 0
3 years ago
Is 4 the solution to -2x+5=-3
lesya [120]
The answer to -2x+5=-3 is indeed , 4
6 0
3 years ago
Read 2 more answers
(e) The cost of building the ship was $153 000 000. Write 153 000 000 in standard form.​
Ostrovityanka [42]

Answer:

1.53 x 10 8

Step-by-step explanation: the 8 is small i just didnt know how to make it small lol

4 0
2 years ago
How do I multiply at 9/25×1/6
bekas [8.4K]

Answer:

3/50

Step-by-step explanation:

It's not as hard as you might think! You can just multiply the denominator and numerators separately. So in this case, you just need to do 9*1 and 25*6. This means that the answer is just 9/150, simplify it and you get, 3/50!

4 0
4 years ago
Other questions:
  • If the right triangular prism shown has a volume of 15 cubic inches, what is the height of the triangular base of the prism, H?
    8·1 answer
  • How many intervals of 1/2 are between -1 and 2?
    8·1 answer
  • A contractor needs to buy nails to build a house. The nails come in small boxes and large boxes. Each small box has 50 nails and
    7·2 answers
  • A sequence is defined by mc024-1.jpg, and mc024-2.jpg. What is the seventh term?
    10·2 answers
  • A certain TV can be purchased from the manufacture for $150. A certain online trailer has a standard markup of 30%, A certain su
    13·1 answer
  • Use the values in the table to determine the slope.
    14·2 answers
  • Which inequality represents the stated situation : A theater is made to receive no more than 750 spectators. Group of answer cho
    10·1 answer
  • Troy is going to spain and needs to convert his dollars to Euros. He knows that when he goes, $5.00 is equivalent to about 3.45
    12·1 answer
  • If Jose earned 145.60 for 7 hours, how many hours would he have to work to earn $83.20?
    9·1 answer
  • Which expressions are equivalent to 5+(-3)(6x-5)5+(−3)(6x−5)5, plus, left parenthesis, minus, 3, right parenthesis, left parenth
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!