The elements stored in TreeMap are ordered because it uses a red-black binary tree structure as its underlying data structure. The basis for comparison is:

'D. Node element key-value'

TreeMap Ordering: Understanding Key-Value Comparison in Java