• <bdo id='A1OLq'></bdo><ul id='A1OLq'></ul>

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

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

      <legend id='A1OLq'><style id='A1OLq'><dir id='A1OLq'><q id='A1OLq'></q></dir></style></legend>

      1. 为什么 C++ STL 不提供任何“树"?容器?

        时间:2023-10-06

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

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

                  本文介绍了为什么 C++ STL 不提供任何“树"?容器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  为什么 C++ STL 不提供任何树"容器,而最好使用什么?

                  我想将对象的层次结构存储为树,而不是使用树作为性能增强...

                  解决方案

                  您可能想要使用树的原因有两个:

                  您想使用树状结构来反映问题:
                  为此,我们有 boost 图形库

                  或者你想要一个具有树状访问特征的容器为此,我们有

                  • std::map(和 std::multimap)
                  • std::set(和 std::multiset)

                  基本上这两个容器的特性是它们实际上必须使用树来实现(尽管这实际上不是必需的).

                  另见这个问题:C 树实现

                  Why does the C++ STL not provide any "tree" containers, and what's the best thing to use instead?

                  I want to store a hierarchy of objects as a tree, rather than use a tree as a performance enhancement...

                  解决方案

                  There are two reasons you could want to use a tree:

                  You want to mirror the problem using a tree-like structure:
                  For this we have boost graph library

                  Or you want a container that has tree like access characteristics For this we have

                  • std::map (and std::multimap)
                  • std::set (and std::multiset)

                  Basically the characteristics of these two containers is such that they practically have to be implemented using trees (though this is not actually a requirement).

                  See also this question: C tree Implementation

                  这篇关于为什么 C++ STL 不提供任何“树"?容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:重载括号运算符 [] 以获取和设置 下一篇:C++ struct 语法“a : b"是什么意思?意思是

                  相关文章

                  最新文章

                  <tfoot id='5Vnie'></tfoot>

                  <small id='5Vnie'></small><noframes id='5Vnie'>

                  • <bdo id='5Vnie'></bdo><ul id='5Vnie'></ul>
                2. <legend id='5Vnie'><style id='5Vnie'><dir id='5Vnie'><q id='5Vnie'></q></dir></style></legend>

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