I am implementing my own data structure for storing objects, these objects have an ID and also a date attached. The operations I must implement require me to sometimes return say an array in date order, or find an object by its ID.
How can I minimise the time complexity for both date and ID in this scenario, would the best approach be to have two separate trees and accept the storage complexity cost?
Any guidance and help is appreciated, thanks!