Solved

keyword grouping search

Posted on 1998-07-29
7
221 Views
Last Modified: 2010-04-15
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.....
0
Comment
Question by:mabo
7 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1251875
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.
0
 
LVL 10

Expert Comment

by:rbr
ID: 1251876
Why do you reject alexos answer? Pls give more info what you want to do!
0
 
LVL 11

Expert Comment

by:alexo
ID: 1251877
Yea, mabo, your chances of getting a good answer will be much better if you explain what's wrong with the proposed ones.
0
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 

Author Comment

by:mabo
ID: 1251878
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.
0
 
LVL 11

Expert Comment

by:alexo
ID: 1251879
What's so complicated about a hash table (the most common implementation of an associative array)?
0
 
LVL 3

Accepted Solution

by:
xyu earned 200 total points
ID: 1251880
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 :)

0
 

Author Comment

by:mabo
ID: 1251881
xyu, email at Cobra__77@hotmail.com and I will send you more details.
Thanks
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now