decision tree with average performance of less than 8 compar
decision tree with average performance of less than 8 comparisons for a set of 6 distinct numbers?
decision tree with average performance of less than 8 comparisons for a set of 6 distinct numbers?
decision tree with average performance of less than 8 comparisons for a set of 6 distinct numbers?
Solution
Given that Decision tree with average performance of less than 8 comparisions for a set of 6 distinct numbers so we take 5 numbers using 7 comparisions.
Compare A to B and C to D without losing of generality(WLOG) that is suppose A>B and C>D, compare A to C. Generality(WLOG), suppose A>C.
Sort E into A,C,D. and this sorting done by two comparisions. Sort B into E,C,D and this can be done by two comparisions, for total of seven.
