I want to write a recursive algorithm to find a smallest element. I draw a binary tree in which leaf represents the elements and internal nodes are smallest elements after comparison.
Input to algo is :
5 3 1 9 8 7 6 10
Binary Tree :
Output : 1
I need to find an algorithm that somehow incorporates this binary tree. First compare pair of elements and than reduced the problem to n/2 then n/4 .. and when n become 1 we get the answer.