Question: Algorithms- In this problem we're going to find the second smallest element in a list of n elements. (a) Show that scanning through the list

Algorithms-
In this problem we're going to find the second smallest element in a list of n elements. (a) Show that scanning through the list twice for the minimum cannot be a solution to this problem. (b) Describe an algorithm which finds the second smallest element with T(n)n+lg(n)2 comparisons at most. [Hint: Think about a recursive solution. ] (c) Consider the recurrence T(n)=T(n/2)+n/2+1. Show that this matches with the formula above by substituting the answer in for T(n/2) and showing that it should match
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
