i am good with the implementation part, i just want to know how the values will be inserted in tree map based on the Comparator or comparable. please don't just give the implementation of comparable and Comparator.
Basically i want to know how different Comparable and Comparator are when it comes to insertion of values in Red Black Tree(underlying data structure of TreeMap). how the insertion will be done.? if it is comparable, with which object inserted object will be compared? if it is Comparator, which two objects would be compared to get the appropriate position in tree. it would be great if there is an example