I read that the std card is implemented using the binary tree data structure.
BST is a sequential data structure (for example, elements in an array) that stores elements in a BST node and maintains elements in their order. E.g. if the element is smaller than the node, save it to the left of the node and if it is larger than the node, save it to the right of the node. With this approach, we achieve O (log n) complexity for various operations such as search, insert, etc.
However, the std card is an associated container. We have a key and a pair of values ββto insert. Is it really implemented using BST and, if so, how? In BST, we have no key or value. This is a kind of standard container.
I'm a little confused. Please help me provide clarification. This does not affect my work, but I want to understand them better. Thank you for your help.
source
share