Answer the question
In order to leave comments, you need to log in
How to organize a data structure for storing a list of users?
I'm trying to find an efficient structure for working with data.
Conditions
The structure stores data in the following format:
Answer the question
In order to leave comments, you need to log in
For ts you make a binary tree, for id - a dictionary. In a tree, leaves can be references to objects in a dictionary or vice versa, it doesn't matter.
In this case, by id - the operation will be linear, by tree - log (n)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question