Use a Binary Search Tree to Process Simple Data in Java