4 ms·
As for whether or not the data structure exists, it does. :) The std::map in C++ is a sorted dictionary, for instance. But it can be uncommon to require this,
by makecheck 18y ago
As for whether or not the data structure exists, it does. :) The std::map in C++ is a sorted dictionary, for instance.
But it can be uncommon to require this, usually for two reasons. One, the data set may be huge. And two, much of your code may not even "care" if the data is sorted. In either of those cases, if automatic sorting occurs, a lot of compute time may be wasted for no net benefit. (A solution is to have data sorted "on demand" within the code that actually cares about sort order.)