How TreeMap does what it does.

Printable View