Unique sorted words

Just in case you are a java programmer or love java for any reason, here is a something for you to smile. Sometimes we get jumbled in problems which can be solved very easily if we think logically.

 

There was a situation where we had to find eliminate duplicate values from a file. One way is to go through all those entries one by one, matching with rest of them. Other way is to sort them and eliminate duplicate entries from simultaneous groups. Third way is to write a java program using TreeSet which will keep unique entities in ascending sorted order by default. Similar way is to insert all values in oracle table and write a query involving column name and rownum.

 

Thanks to M for coming up with this problem and suggesting to write a prog and rest was a cakewalk.

Leave a Reply

Your email address will not be published. Required fields are marked *