Created
July 11, 2011 20:54
-
-
Save alvesjnr/1076774 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Interval structure | |
| Implement an efficient data structure for storing keys in intervals | |
| mapping to values. The interval is defined as a 2-tuple: {low, high}. | |
| When creating a new map the user can choose if the interval is open or | |
| closed, in both ends. | |
| Eg. given the left-closed, right-open map M= | |
| [1, 10) -> a | |
| [10, 20) -> b | |
| [20, 30) -> c | |
| find(1,M) = a | |
| find(15,M) = b | |
| find(20,M) = c | |
| find(30,M) – EXCEPTION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment