Are Huffman trees and optimal binary search trees for solving the same problems?
Both Huffman trees and optimal binary decision trees can be though of as mechanisms for playing the (probabilistic) 20 questions game optimally. In the 20 questions game you are given a set of items $X$ and a probability distribution $\pi$ over $X$, and then you are presented an unknown item $x \sim \pi$. Your task is to discover $x$ using the least expected number of questions. The difference lies in which questions are allowed:


In the case of Huffman trees, you can ask any Yes/No questions of your choice.
In the case of BSTs, you can ask a 3-way question of the form "$x &lt; t$, $x = t$, or $x &gt; t$?".


Neither Huffman trees nor binary search trees are described in this way usually. Instead:


Huffman trees can be viewed as a way of coding elements drawn from $\pi$ in a prefix-free way (no codeword is the prefix of another). The code of an element consists of the path that takes you from the root to the appropriate leaf ($0$ for taking a No edge, $1$ for taking a Yes edge).
Binary search trees allow searching $x$ inside a list $y_1,\ldots,y_n$. The answer is either $y_i$ (this corresponds to items stored in internal nodes), or $y_i &lt; x &lt; y_{i+1}$ (this corresponds to items stored in leaves; this includes the cases $x &lt; y_1$ and $y_n &lt; x$).


This should answer most of your questions.