Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Both these trees try to keep the most frequently accessed element at the top. Is there any difference between these two trees?

share|improve this question
How do you get the optimal structure? From Wikipedia on optimal binary search trees "If we do not know the sequence in which the elements in the tree will be accessed in advance, we can use splay trees which are asymptotically as good as any static search tree we can construct for any particular sequence of lookup operations." – user40980 Feb 26 '14 at 3:19
up vote 2 down vote accepted

A Splay Tree is a specific variation of binary tree, specifying certain attributes of how the tree should be implemented. An Optimal Binary Search Tree is any binary tree for which the lookup cost is minimized.

One describes the implementation, the other describes the result.

So your question is a bit like asking "What's the difference between a Rally Car and a Fast Car?" The answer is that the question doesn't really make sense.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.