For example,
set < set<int> , less<set<int>> > K; How is K stored in memory? set is stored in memory in sorted form as a binary tree, and set <set <int>> in which?
For example,
set < set<int> , less<set<int>> > K; How is K stored in memory? set is stored in memory in sorted form as a binary tree, and set <set <int>> in which?
Usually set<T> is implemented using binary search trees ( binary search tree, BST ). Searches, deletes, and inserts have an average complexity of O (log n) , and iteration is also supported.
In the case of nested sets set<set<T>> second-level sets are stored in the elements of the tree. Second level sets are sorted using the comparison operator < , which for sets is set as a lexicographical order .
Source: https://ru.stackoverflow.com/questions/474809/
All Articles