Recursion
Recursion
Recursion
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Efficiency of Binary Search and<br />
the Comparable Interface<br />
• At each recursive call we eliminate half the array<br />
elements from consideration<br />
• O(log 2 n)<br />
• Classes that implement the Comparable interface must<br />
define a compareTo method that enables its objects to<br />
be compared in a standard way<br />
• CompareTo allows one to define the ordering of<br />
elements for their own classes