Your friend Maggie is charged with organizing the next Wipeout competition
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

Your friend Maggie is charged with organizing the next Wipeout competition

1. Your friend Maggie is charged with organizing the next Wipeout competition for which she must decide on the obstacles that should be set for the contestants participating. Maggie would like most of the obstacles chosen to be the favourites of the viewers. Luckily, she already has the data of past competitions from which she can extract such information. The data of n objects includes the following information: name of each obstacle and for each obstacle the number of viewers that prefer this obstacle over all others. From this data Maggie wants to pick the i obstacles that have the most number of viewers and rank them according to the number of views.

(a) Help Maggie to come up with an O(n + i logi)-time algorithm that finds the i obstacles that have the most number of views and are ranked in order of the number of views.

(b) b Justify the O(n +ilgi) time complexity of your algorithm.

Hint
Computer"n indicates the input size, while O is the worst-case scenario growth rate function. We use the Big-O notation to classify algorithms based on their running time or space (memory used) as the input grows. The O function is the growth rate in function of the input size n. Let's use T(n) as the total time in function of the input size n , and t as the time complexity taken by a statement or...

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.