1 20 Points Suppose Disposal Worst Case Linear Time Median Subroutine Called Black Box Tak Q37105829

1. (20 points) Suppose we have at our disposal a worst-case linear-time median subroutine called black-box, which takes an

1. (20 points) Suppose we have at our disposal a worst-case linear-time median subroutine called “black-box”, which takes an Array A containing n elements as input and returns the median element of A in linear time (O(n)) in the worst case. Give a simple, linear-time algorithm that uses “black-box” as a subroutine and returns the ith smallest element of A in linear time. Call your function Select, write down its pseudo code, recurrence relation and solve the recurrence

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.