Ask Question

Suppose that an algorithm uses only comparisons to find the i th smallest element in a set of n elements. Show that it can also find the i 1 smaller elements and the n i larger elements without performing any additional comparisons

+4
Answers (1)
  1. 6 June, 07:15
    0
    If the given algorithm employs m comparisons to determine 'x' that is the ith smallest element in a given sample of n elements. By tracing the m comparisons in the given log, the i - 1 smaller elements can be determined by the theory of transitivity. Furthermore, If x > a and a > b, then x > b can be estimated without actually conducting a comparison between x and b. Similarly, the n - i larger elements can be found, too. It is uncertain that there is a possibility of x greater than a certain number or not by the comparison in the given log. It is not possible. Otherwise, the algorithm does not work correctly.

    Explanation:

    If the given algorithm employs m comparisons to determine 'x' that is the ith smallest element in a given sample of n elements. By tracing the m comparisons in the given log, the i - 1 smaller elements can be determined by the theory of transitivity. It is uncertain that there is a possibility of x greater than a certain number or not by the comparison in the given log.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Suppose that an algorithm uses only comparisons to find the i th smallest element in a set of n elements. Show that it can also find the i ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers