>
>
> On Sun, Oct 30, 2011 at 1:17 AM, Aamir Khan <ak4u2...@gmail.com> 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 the student-course relationships. You can use
>> arrays, lists, stacks, trees, graphs, etc. or come up with your own data
>> structures. Give the running times, in Big O notation, for the following
>> operations for your data structure and justify the answers:
>>
>> a) Return all students in a list.
>> b) Return all courses in a list.
>> c) Return all courses in a list for a given student.
>> d) Return all students in a list for a given course.
>>
>>
>> Lets bring a little bit complication,

What if a students wants to know list of all people who share maximum
number of courses with him/her ?

Naive approach : First getting all the courses from the hash tables and
then for each course traversing its list of students, for each student
encountered in this way we can just increase the count. Then all the people
having maximum count and print them.

Any better approach ?

>
>>
>>
>> Aamir Khan | 3rd Year  | Computer Science & Engineering | IIT Roorkee
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>


-- 
Aamir Khan | 3rd Year  | Computer Science & Engineering | IIT Roorkee

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to