• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

keyword grouping search

can someone suggest a data structure for a keyword grouping or search?
say eg I have 500-600 students and each student is interested in one or more sports...I want to group keywords (ie sport name ) to find all those students who are interested in similar sports...

I think it is similar to a library search ...when we want to do a keyword search for a book....

any suggestions.....
1 Solution
Well, an associative array with the sprts name as an index and a linked list of pointers (or indexes) to students seems to fit the bill.

An associative array can be eiifciently implemented using a hash table.
Why do you reject alexos answer? Pls give more info what you want to do!
Yea, mabo, your chances of getting a good answer will be much better if you explain what's wrong with the proposed ones.
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

maboAuthor Commented:
associative array is too complicated (at least for me) in  C.
associative array is easy in Perl ... but I perfer C, hence posting this question in C area.

I will appreciate any other comments or suggestions.
What's so complicated about a hash table (the most common implementation of an associative array)?
ok... lets do this... if number of sprots kind isn't big like 32 kind of sports o something You can give to each sport an Id from 1 to 32 or 64 of 128.... then You transfering set of the sports into bit mask ... and search though a list of the students using bitwize & or something to check the sprts set they are interesting... I can give You a source if You can give more details :)
Meanwile: If You can use C++ You can use STL classes or go to http:\\come.to\okthinks and download Natlib Template Library and use some complex data structures..
Note: for this number of entities the bitwize solution will be faster because it can be performed almoust without pointers operation memory allocation and hash calculation... etc using the basic CPU instruction only :)

maboAuthor Commented:
xyu, email at Cobra__77@hotmail.com and I will send you more details.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now