I have a requirement like there is an item A that has several sub items like a1,b1,c1… and each sub-item has in turn several sub-items like {a11,a12,a13…} which correspond to a1 and {b11,b12,b13..} which correspond to b1. So, its basically like a tree structure with item A as the root. Now, there is some time-stamp associated with each item and its sub-items. The time-stamp is different for all these items and sub-items. I need to find the item/sub-item with the latest time-stamp. How to proceed to solve this in java. Im kind of new to using data structures.
Share
Use TreeMap
It will suit your need. Here is a sample program from java.samples.com