Question: Figure 10.75 shows a routine to flip a coin, assuming that random returns an integer (which is prevalent in many systems). What is the expected

Figure 10.75 shows a routine to flip a coin, assuming that random returns an integer (which is prevalent in many systems). What is the expected performance of the skip list algorithms if the random number generator uses a modulus of the form M = 2B (which is unfortunately prevalent on many systems)?

CoinSide flip( ) { if( ( random( ) % 2 ) == 0 ) 3 return HEADS; else return TAILS; }

CoinSide flip( ) { if( ( random( ) % 2 ) == 0 ) 3 return HEADS; else return TAILS; }

Step by Step Solution

3.48 Rating (174 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

If the modulus is a power of two then the least significant ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

1486-C-S-A(533).docx

120 KBs Word File

Students Have Also Explored These Related Algorithms Questions!