Question
C++ SKIP LIST: (please use worded explanation ) Suppose I am writing a program that will use a skip list with maximum height h =
C++ SKIP LIST: (please use worded explanation )
Suppose I am writing a program that will use a skip list with maximum height h = 3log n - that is, when I add an element to the skip list, if I get 3log n heads in a row, I will stop adding height to the element. You cannot modify my code or select the input. You can, however, change the way the coin works from 50% heads, 50% tails (current status) to another set of probabilities (which must still add up to 100%). You cannot introduce other results: the coin can still only land on heads or tails (no sideways landing, for instance).
Your goal is to cause my Skip List to use the maximum possible amount of space. How would you bias the coin to achieve this effect? Explain briefly why this will cause the given problem.
ans = you should convert it to 100% heads. This will cause it to fill each newly added element to the top, each of which takes some space.
why is this the answer? and theres no code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started