 <p>There are a <em>ton</em> of different use cases for balanced BSTs and I can't possibly list all of them here, but here are a few good use cases:</p> <ol> <li><p>BSTs support <em>range queries</em>, where you can ask for all entries between two values, efficiently. Specifically, in a BST with n entries, if you perform a range query where k elements will be returned, the runtime is O(log n + k). Compare that to, say, using a hash table, where the runtime would be O(n). This can be used if you're interested in doing time series analysis of a set of data and want to explore data in certain ranges.</p></li> <li><p>BSTs support <em>successor and precedecessor</em> queries. Given a BST, you can ask for the smallest element greater than some value or for the largest element less than some value in time O(log n). Collectively, this lets you find the element in a BST that's closest to some target value in time O(log n), which can be useful if you're getting noisy data and want to map it to the closest entry in your data set. Compare this with hash tables, where this would take time O(n).</p></li> <li><p>BSTs are <em>worst-case efficient</em>. Many common types of binary search trees, like red/black trees and AVL trees, give worst-case guarantees on the costs of their operations. Contrast this with a hash table, where queries are <em>expected</em> to take constant time, but can degrade with a bad hash function or just due to bad luck. Additionally, every now and then a hash table has to rehash, which can take a while, but red/black trees and AVL trees don't have cases like these. (There are some types of balanced BSTs like splay trees and scapegoat trees that aren't worst-case efficient, but that's a different story.)</p></li> <li><p>BSTs give easy access to the <em>minimum and maximum values</em> in time O(log n), even if insertions and deletions are intermixed. Hash tables can't support these operations.</p></li> <li><p>BSTs support <em>ordered iteration</em>, so if you have an application where you want to view the data in sorted order, you get it "for free" with BSTs. One example of this would if, for example, you were loading student data and wanted to see the scores in sorted order. Hash tables don't support this - you'll have to pull out the data and sort it to get it back in sorted order.</p></li> <li><p>BSTs can be <em>augmented</em>. If you take an algorithms course, you'll probably learn about a technique called tree augmentation in which you can add extra information in each node of the BST to solve a ton of problems much faster than it would initially appear possible to do. For example, you can augment BSTs to instantly be able to read off the median element, or the closest pair of points, or to solve many algorithmic problems efficiently when the underlying data is changed. Hash tables don't support these operations.</p></li> <li><p>BSTs support <em>efficient split and join</em>. Red/black trees and splay trees have the interesting property that, given two trees where all the keys in one are less than the keys in the other, the trees can be combined together into a single tree in time O(log n) - much faster than visiting all elements of the tree! You can also split any red/black tree or splay tree into two smaller trees by partitioning the tree into "elements less than some value" or "elements more than some value" in time O(log n). It's not trivial to do it, but it's possible. The time bounds on the corresponding operations on a hash table are O(n).</p></li> </ol> <p>If I think of anything else, I'll update this list. Hope this helps!</p>