久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

為什么 std::map 實現(xiàn)為紅黑樹?

Why is std::map implemented as a red-black tree?(為什么 std::map 實現(xiàn)為紅黑樹?)
本文介紹了為什么 std::map 實現(xiàn)為紅黑樹?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

為什么 std::map 實現(xiàn)為 紅黑樹?

有幾種平衡的二元搜索樹 (BST).選擇紅黑樹的設(shè)計權(quán)衡是什么?

There are several balanced binary search trees (BSTs) out there. What were design trade-offs in choosing a red-black tree?

推薦答案

可能兩種最常見的自平衡樹算法是 紅黑樹 和AVL 樹.為了在插入/更新后平衡樹,兩種算法都使用旋轉(zhuǎn)的概念,其中樹的節(jié)點被旋轉(zhuǎn)以執(zhí)行重新平衡.

Probably the two most common self balancing tree algorithms are Red-Black trees and AVL trees. To balance the tree after an insertion/update both algorithms use the notion of rotations where the nodes of the tree are rotated to perform the re-balancing.

雖然在兩種算法中插入/刪除操作都是 O(log n),但在紅黑樹重新平衡旋轉(zhuǎn)的情況下是一個 O(1) 操作,而使用 AVL 這是一個 O(log n) 操作,使得紅黑樹在重新平衡階段這方面的效率更高,也是它更常用的可能原因之一.

While in both algorithms the insert/delete operations are O(log n), in the case of Red-Black tree re-balancing rotation is an O(1) operation while with AVL this is a O(log n) operation, making the Red-Black tree more efficient in this aspect of the re-balancing stage and one of the possible reasons that it is more commonly used.

紅黑樹用于大多數(shù)集合庫,包括來自 Java 和 Microsoft .NET Framework 的產(chǎn)品.

Red-Black trees are used in most collection libraries, including the offerings from Java and Microsoft .NET Framework.

這篇關(guān)于為什么 std::map 實現(xiàn)為紅黑樹?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Assertion failed (size.widthgt;0 amp;amp; size.heightgt;0)(斷言失敗(size.width0 amp;amp; size.height0))
Rotate an image in C++ without using OpenCV functions(在 C++ 中旋轉(zhuǎn)圖像而不使用 OpenCV 函數(shù))
OpenCV: process every frame(OpenCV:處理每一幀)
Why can#39;t I open avi video in openCV?(為什么我不能在 openCV 中打開 avi 視頻?)
OpenCV unable to set up SVM Parameters(OpenCV 無法設(shè)置 SVM 參數(shù))
Convert a single color with cvtColor(使用 cvtColor 轉(zhuǎn)換單一顏色)
主站蜘蛛池模板: 啪一啪| 99在线免费观看视频 | 三级黄色大片网站 | 国产精品久久国产精品久久 | 在线观看国产视频 | 精品久久久久久久久久久久久久 | 伊色综合久久之综合久久 | 日韩1区| 精品久 | 日韩性在线 | 欧美国产视频一区二区 | 激情五月综合网 | 极品久久 | 亚洲视频在线免费观看 | 完全免费av在线 | 久久尤物免费一区二区三区 | 免费看黄色国产 | 久久99网 | 欧美视频1区 | 成人片免费看 | 久久久久久久一区 | 超碰免费在 | 欧美日韩精品久久久免费观看 | 欧美国产日韩一区二区三区 | 成人免费在线播放视频 | 国产高清在线观看 | 一区二区在线 | 久久久久久久久99 | 午夜精品一区二区三区免费视频 | 精品一区二区久久久久久久网站 | 国产欧美在线一区 | 国产免费一级一级 | 成人免费大片黄在线播放 | 亚洲国产网| 亚洲国产精品激情在线观看 | 日本精品免费 | 国产精品99精品久久免费 | 美女张开腿露出尿口 | a级黄色毛片免费播放视频 国产精品视频在线观看 | 色综合一区二区三区 | 欧美中文字幕 |