Re: [algogeeks] What Data Structure to use ?

2011-10-29 Thread Aamir Khan
> > > On Sun, Oct 30, 2011 at 1:17 AM, Aamir Khan wrote: > >> In a university, students can enroll in different courses. A student may >> enroll for more than one course. Both students and courses can be >> identified by IDs given to them. Design a data structure to store >> students, courses, and

Re: [algogeeks] What Data Structure to use ?

2011-10-29 Thread Sahil Garg
Create a hash table for students and another hash table for course.. For each record in the student table create a linklist that stores the list of all the course in which the particular student in enrolled. For each record in the course table create a linklist that stores the list of all the stude

Re: [algogeeks] What Data Structure to use ?

2011-10-29 Thread Nitin Garg
Assuming students and courses have unique integer ids. Use an adjacency list kind of data structure. Where the location of the student/course in the list can be decided by hashing. Essentially, there will be 3 hash tables, 1. To store student objects. Key - student id, value- student object. 2. T