By dotCore
via rmarcus.info
Submitted: Mar 10 2013 / 03:06
Recently, I came across a problem in which I had to store contacts in an instant message application. I needed to be able to display the list of contacts to the user in alphabetical order, and I needed to be able to retrieve a contact object quickly. One data structure that accomplishes all this is a simple binary tree — an in-order traversal of the tree will produce the list of contacts in alphabetical order, and a balanced binary tree provides search time.
Add your comment