I think Hash-map With Separate Chaining Will be Best Where Key Will be Name of country & value will be pointer to linked list that will hold all the scene Shooted in that country so hope it pretty clear that as we shooting scene randomly so whenever new scene Shooted put into bucket of Hash-map if starting pointer of linked is null else if scene from same country repeats again then add it to last or first its can be done O(1) & repeat the same for remaining scene so when particular scene will be displayed just display it & increment the corresponding pointer of bucket ..It just an approach we have to take care of out system requirement & complexity Issue (time & space) so in this case whenever collision occur string an item can be done in O(1) but retrying the item may take the time of length of linked list in particular bucket O(n)
See There are several DS & several way we can do insertion , searching, deletion operation in O(1) but not all of the same time but here is problem is that of associativity i mean every scene is associated with particular country Correct me if anything Wrong or Optimization or Suggest Any DS.that can perform both operation very fast ?? Thanks Shashank>>"The Best Way to Escape From The Problem is to Solve It" CSE,BIT Mesra Reach Me:+91- 9739002481 -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.