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.
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:
multimapstring, yourResultDataType contentsContainingTopic;
multimapstring, yourResultDataType
Use a B-Tree implemented using nested map as:
*mapstring, mapstring, mapstring, yourResultDataType 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
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,
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
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
dual key hashmap actor,film
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Sun, Apr 8, 2012 at 2:37 PM, bharat b bagana.bharatku...@gmail.comwrote:
Maintain an vector of structure Film_actors for List of actors
Maintain an vector of structure
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
Hello All,
I would like to implement a tree with the following properties.
1. The tree is balanced.
2. Each node has a max of 7 sub nodes and min of ceil(7/2) sub nodes.
3. Number of nodes known from the beginning.
How would I implement this? Is there a data structure that I can use?
Consider