Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(1) a) What is E, (3/4)*? b) What is the i i(3/4)'? (2) A coin has 1/4 chance of having heads, 3/4 chance of having

image text in transcribed

(1) a) What is E, (3/4)*? b) What is the i i(3/4)'? (2) A coin has 1/4 chance of having heads, 3/4 chance of having tails. It is tossed n times. a) What is the expected number of coin tosses needed to get a heads? b) What is the probability that the number of heads equals the number of tails? Write the expression using () notation, and then see if you can approximate what this gives. (3) If we change the randomized QUICKSORT algorithm so that it repeatedly ran- domly selects a pivot and runs PARTITION until it finds a good pivot like our SELECT does, and suppose we keep track of the pivots used so far so we never use one twice for the same array, what is the worst case cost of the algorithm? Give a recurrence for this and its asymptotic solution (you can use the master method.) (4) Suppose we have a table with 9 slots and use the hash function h(k) = k mod 9 where collisions are resolved by chaining. What does the table and chains look like after hashing 5, 28, 19, 15, 20, 33, 12, 17, 10. (5) Consider inserting the keys 10, 22, 31, 4, 15, 28, 17, 88, 59 into a hash table of length m = 11 using open addressing with the auxiliary hash function h'(k) = k. What are the results using a) linear probing; b)quadratic probing with e= 1 and d' = 3; c) double hashing with h1(k) = k and h2(k) = 1+ (k mod (m 1))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

Students also viewed these Databases questions

Question

Prepare closing entries for the Andrews Corporation

Answered: 1 week ago

Question

What is the cerebrum?

Answered: 1 week ago