sorted multimap

closed account (GTMi1hU5)
Heylo! I have to do an abstract data type: sorted multimap and in the implementation to use a binary search tree.I've tried looking for some theory and examples, but I couldn't find any (if you know any please tell me).
I need an idea of how can I use this ADT, so I can prove it's utility (like organizing students in a class based on some criteria). Any ideas?
> I need an idea of how can I use this ADT, so I can prove it's utility
> (like organizing students in a class based on some criteria).

For instance, the key is the course_id, and the mapped value is the student_id. Many students may enrol for the same course.


> some theory and examples

See: https://en.wikipedia.org/wiki/Binary_search_tree

Since multiple keys with the same value is allowed in a multi-map, the value property could be:
For every node,
The value of keys in nodes of the right sub-tree is greater than the the value of the key in the current node.
The value of keys in nodes of the left sub-tree is less than or equal to the value of the key in the current node.
Topic archived. No new replies allowed.