That's what a binary search tree is.
Now [COUGH] in Java, again, without going into detail of Java code,
for those of you who don't know it, you might have to read
the Algorithms book a bit to really follow all of this.
And those of you who do know it, but either way, it's very elegant and simple,
small amount of code to implement nodes and binary trees in Java.
So we build a data type that holds this associated information,
so that we can manipulate it and keep it together and
write programs that manipulate, you'll see what those look like in just a minute.
And the only operation that we need to perform is to be able to create a new
node, with a given key and value.
And that's what this code does, is defines that data type, a node's got four fields,
it's got a key and a value, and it's got a reference to the two subtrees.
The left subtree has smaller keys, and the right subtree has larger keys.
And that's how we represent it.
And for programming language aficionados, we usually use generic types for
keys, which means that we can hold any type of data with that.
And again, you can read about these details in the Algorithms book.