I currently have data that I need sorted in two different ways, from a time and space complexity PoV, is there any alternative to maintaining two trees, one sorted by date and one by ID number? I need to be able to return lists in order of data, and individual users by ID, and I would prefer not to have to traverse or even worse, traverse and then sort for the array returns.
Any insight or help is much appreciated, thanks!