Re: [algogeeks] Which Data Structure to use

2014-04-15 Thread Abhay Prakash
Probably you can make separate *multimap *for each of the attribute and while retrieval, taking intersection of sets associated with each of the attribute. The three tables could be: multimap contentsContainingTopic; multimap contentsContainingLocation; multimap contentsContainingLocale; For any

Re: [algogeeks] Which Data Structure to use

2014-04-14 Thread Narsimha Raju
Hi Abhay, Thanks for your solution, seems good as it is covering all the 3 attributes. Nesting of Hashmap to 3 layers is little clumsy. For Example if we increase from 3 to 4 attributes we can see the complexity of handling the things. I would like to know, do we have any other solutions.

Re: [algogeeks] Which Data Structure to use

2014-04-13 Thread Abhay Prakash
I think there is a correction for the time complexities: For the case when all three parameters are given, the time complexity will be *O(log(numTopics) + log(numLocations) + log(numLocale)). *Reason being it is like search on three different trees - after the key *topicValue* has been searched, o

Re: [algogeeks] Which Data Structure to use

2014-04-13 Thread Abhay Prakash
Use a B-Tree implemented using nested map<> as: *map > > table;* Now for each level the complexity will be log(numOfElementsAtThatLevel). e.g.* if you have all three parameters, the complexity of retrieval will be O(log(numTopics)*log(numLocations)*log(numLocale)).* For the missing parameters it

[algogeeks] Which Data Structure to use

2014-04-10 Thread Narsimha Raju
Hi, I have a question and i would like to know the data structure to be used for this. ​You have 3 attribute 1. Topic 2. Location 3. Locale User can give any of the three or all the them to retrieve the content. For example. 1. Politics, Hyderabad, English In this case we nee

Re: [algogeeks] Which data structure to use in searching a list for information about - -

2012-04-10 Thread Rose
Thanks Bharat and Ashish; Sorry my knowledge is so basic, I'm not yet with you. The example they gave was: % film.txt ... Tin men (1987) / DeBoy, David/Blumenfeld, Alan/ --- /Geppi, Cindy/Hershey, Barbara Titanic (1997) /Mazin, Stan/...DiCaprio, Leonardo/.../Winslet, Kate/... To Die For (1995

Re: [algogeeks] Which data structure to use in searching a list for information about - -

2012-04-09 Thread Ashish Goel
dual key hashmap Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652 On Sun, Apr 8, 2012 at 2:37 PM, bharat b wrote: > Maintain an vector of structure "Film_actors" for "List of actors" > Maintain an vector of structure "Actor_films" for "List of Film

Re: [algogeeks] Which data structure to use in searching a list for information about - -

2012-04-08 Thread bharat b
Maintain an vector of structure "Film_actors" for "List of actors" Maintain an vector of structure "Actor_films" for "List of Films" I'll explain this with the help of an example . Films: 1.Hai 2.Bye Actors: A,B,C,D acted in Film Hai. A,D,F,G acted in Film Bye. struct Film_actors { String Film_na

[algogeeks] Which data structure to use in searching a list for information about - -

2012-04-06 Thread Rose
Thanks all of you. I'm new to algorithms and data structure and I'm new in this forum. I have an assignment but not sure yet: A. Describe a data structure which can effectively answer the following questions: 1. A list of actors (f) : Print a list of actors who took part in film* f * . 2. A list