-
Notifications
You must be signed in to change notification settings - Fork 1
Description
As mentioned on page 17 and in several other places in CLRS, the actual data type that arrays or other data structures store, is a record. A record consists of a key and other data, called satellite data. Keys are used to determine the positions of records in data structures and are often the only representation used in the book to illustrate algorithms and data structures. When not critical, satellite data is hidden for simplicity.
Consider using records whenever applicable in implementations. Make records comparable, so the algorithm should not explicitly compare records by exposing their key attributes.
As of now, certain implementations use KeyObject class as a record, while others use plain numbers (keys), e.g. Heap contains plain keys, while PriorityQueue contains KeyObjects. Consider renaming KeyObject -> Record and use records consistently.