I have a TreeMap with a set of 'Key and Value' pairs. How can I get both Key and Value at a particular Index of the TreeMap?
EDIT : @TO-ALL : Thanks. But I know how to implement it by using an extra ArrayList. I just thought is there any way to achieve this without using an extra ArrayList.
keys()
,values()
andget(key)
methods. – SambarentrySet
in linear time. – GuestkeySet()
to get the list of keys. Then iterate over them to get to one particular one and useget
method to retrieve the value – Sambar