What are the options for storing hierarchical data in a relational database?

Good Overviews Generally speaking, you’re making a decision between fast read times (for example, nested set) or fast write times (adjacency list). Usually, you end up with a combination of the options below that best fit your needs. The following provides some in-depth reading: One more Nested Intervals vs. Adjacency List comparison: the best comparison … Read more

Search for words with telephone numbers from 2-3-4 tree

The key here would be to acquire all the different character combinations that can derive from the characters related to the supplied number in the left to right sequence of that number. Obviously the larger the supplied number, the more combinations there will be. The number of 26678837 which you provided in your post for … Read more

Bad Operand Types for Binary Operator “>”?

Sure – you simply can’t apply the > operator between objects. What would you expect it to do? You can’t apply any of the other binary operators either – +, -, / etc (with the exception of string concatenation). Ideally, you should make your TreeNode generic, and either have a Comparator<T> which is able to compare any two instances, or make T extend Comparable<T>. Either way, … Read more