<tfoot id='TstF7'></tfoot>

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

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

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

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

        C++中的订单统计树

        Order Statistic Tree in C++(C++中的订单统计树)
        • <bdo id='3TaGw'></bdo><ul id='3TaGw'></ul>

            <tbody id='3TaGw'></tbody>

            • <legend id='3TaGw'><style id='3TaGw'><dir id='3TaGw'><q id='3TaGw'></q></dir></style></legend>

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

                  <small id='3TaGw'></small><noframes id='3TaGw'>

                  <tfoot id='3TaGw'></tfoot>
                  本文介绍了C++中的订单统计树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要标准 GCC STL 地图容器的订单统计树.

                  I need an order statistic tree for standard GCC STL map containers.

                  我查了一下,有一种叫做 PBDS 的东西.基于策略的数据结构.我也不清楚这种用法.

                  I checked and there is something known as PBDS. Policy based data structures. That usage is also not clear to me.

                  谁能告诉我如何将 STL 映射容器用于订单统计树?即使它只在 GNU G++ 上就足够了吗?

                  Anyone can tell me how to use STL map containers for order statistic tree? Even if its only on GNU G++ its enough?

                  推荐答案

                  以下是将 GNU Policy-Based STL MAP 实现为订单统计树的示例(在 Linux gcc 4.6.1 上测试):

                  Here is the example of GNU Policy-Based STL MAP implemented as order statistic tree (tested on Linux gcc 4.6.1):

                  #include <iostream>
                  #include <ext/pb_ds/assoc_container.hpp>
                  #include <ext/pb_ds/tree_policy.hpp>
                  
                  using namespace std;
                  using namespace __gnu_pbds;
                  
                  typedef
                  tree<
                    int,
                    int,
                    less<int>,
                    rb_tree_tag,
                    tree_order_statistics_node_update>
                  map_t;
                  
                  int main()
                  {
                    map_t s;
                    s.insert(make_pair(12, 1012));
                    s.insert(make_pair(505, 1505));
                    s.insert(make_pair(30, 1030));
                    cout << s.find_by_order(1)->second << '
                  ';
                    return 0;
                  }
                  

                  这里是基于 GNU 策略的数据结构概述的链接.这是其他 tree_order_statistics 示例.我找不到有关基于策略的数据结构的好的参考资料,但您可以使用这些链接以及 PBDS 来源.

                  Here is a link to the overview of GNU Policy-Based Data Structures. Here is other tree_order_statistics example. I cannot find a good reference for Policy-Based Data Structures, but you can use these links as well as PBDS sources.

                  这篇关于C++中的订单统计树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Consistent pseudo-random numbers across platforms(跨平台一致的伪随机数)
                  Vary range of uniform_int_distribution(改变uniform_int_distribution的范围)
                  What is a seed in terms of generating a random number?(就生成随机数而言,种子是什么?)
                  Is 1.0 a valid output from std::generate_canonical?(1.0 是 std::generate_canonical 的有效输出吗?)
                  Getting big random numbers in C/C++(在 C/C++ 中获取大随机数)
                  What is the best way to generate random numbers in C++?(在 C++ 中生成随机数的最佳方法是什么?)

                  • <tfoot id='1f48Q'></tfoot>

                    <small id='1f48Q'></small><noframes id='1f48Q'>

                    <legend id='1f48Q'><style id='1f48Q'><dir id='1f48Q'><q id='1f48Q'></q></dir></style></legend>

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