• <tfoot id='93lqy'></tfoot>

      1. <legend id='93lqy'><style id='93lqy'><dir id='93lqy'><q id='93lqy'></q></dir></style></legend>
          <bdo id='93lqy'></bdo><ul id='93lqy'></ul>
        <i id='93lqy'><tr id='93lqy'><dt id='93lqy'><q id='93lqy'><span id='93lqy'><b id='93lqy'><form id='93lqy'><ins id='93lqy'></ins><ul id='93lqy'></ul><sub id='93lqy'></sub></form><legend id='93lqy'></legend><bdo id='93lqy'><pre id='93lqy'><center id='93lqy'></center></pre></bdo></b><th id='93lqy'></th></span></q></dt></tr></i><div id='93lqy'><tfoot id='93lqy'></tfoot><dl id='93lqy'><fieldset id='93lqy'></fieldset></dl></div>

        <small id='93lqy'></small><noframes id='93lqy'>

      2. STL设置了什么样的树实现?

        时间:2023-06-04

        1. <tfoot id='OrYWs'></tfoot>

          <small id='OrYWs'></small><noframes id='OrYWs'>

                  <tbody id='OrYWs'></tbody>
                <i id='OrYWs'><tr id='OrYWs'><dt id='OrYWs'><q id='OrYWs'><span id='OrYWs'><b id='OrYWs'><form id='OrYWs'><ins id='OrYWs'></ins><ul id='OrYWs'></ul><sub id='OrYWs'></sub></form><legend id='OrYWs'></legend><bdo id='OrYWs'><pre id='OrYWs'><center id='OrYWs'></center></pre></bdo></b><th id='OrYWs'></th></span></q></dt></tr></i><div id='OrYWs'><tfoot id='OrYWs'></tfoot><dl id='OrYWs'><fieldset id='OrYWs'></fieldset></dl></div>
                • <bdo id='OrYWs'></bdo><ul id='OrYWs'></ul>

                  <legend id='OrYWs'><style id='OrYWs'><dir id='OrYWs'><q id='OrYWs'></q></dir></style></legend>
                  本文介绍了STL设置了什么样的树实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我知道在 STL 中 vector 表示动态数组的实现.list 表示链表(双向链表)的实现也是如此.我知道 set 有一个类似于 tree 的实现.从算法复杂度来看,集合中的大多数内置函数都是复杂度o(1)o(log n).那么这棵树是作为平衡树实现的还是任何其他类型的树,例如红黑树,如果是这样,为什么选择这样的树结构?

                  I know that in STL vector represents the implementation of a dynamic array. So does the list represents the implementation of a linked list (doubly linked list). I know that set has an implementation similar to tree . Looking at the algorithm complexity as mentioned most of the inbuilt function in set is of complexity o(1) or o(log n). So is this tree implemented as Balanced Tree or any other kind of tree such as red-black tree and if So Why such a tree structure was chosen ?

                  推荐答案

                  该标准对实现没有任何限制(除了复杂性保证).

                  The standard imposes no restrictions on the implementation (other than the complexity guarantees).

                  换句话说,它依赖于实现.通常,它是一棵红黑树(参见例如 /usr/include/c++/xyz/bits/stl_tree.h,其中 xyz 是您的特定 GCC 版本).

                  In other words, it's implementation-dependent. Typically, it's a red-black tree (see e.g. /usr/include/c++/x.y.z/bits/stl_tree.h, where x.y.z is your particular GCC version).

                  这篇关于STL设置了什么样的树实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:__attribute__((packed)) 会影响程序的性能吗? 下一篇:错误:用“{...}"初始化;预期聚合对象 - C++

                  相关文章

                  <small id='Z37OO'></small><noframes id='Z37OO'>

                  <tfoot id='Z37OO'></tfoot>
                  <i id='Z37OO'><tr id='Z37OO'><dt id='Z37OO'><q id='Z37OO'><span id='Z37OO'><b id='Z37OO'><form id='Z37OO'><ins id='Z37OO'></ins><ul id='Z37OO'></ul><sub id='Z37OO'></sub></form><legend id='Z37OO'></legend><bdo id='Z37OO'><pre id='Z37OO'><center id='Z37OO'></center></pre></bdo></b><th id='Z37OO'></th></span></q></dt></tr></i><div id='Z37OO'><tfoot id='Z37OO'></tfoot><dl id='Z37OO'><fieldset id='Z37OO'></fieldset></dl></div>

                    <bdo id='Z37OO'></bdo><ul id='Z37OO'></ul>

                • <legend id='Z37OO'><style id='Z37OO'><dir id='Z37OO'><q id='Z37OO'></q></dir></style></legend>