在C ++中使用平衡树的字典实现 [英] dictionary implementation using balanced tree in c++
本文介绍了在C ++中使用平衡树的字典实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以帮我解决这个问题吗?
我需要使用c ++中的平衡树的概念来实现在字典中插入,搜索和删除的功能.有人可以帮我编码吗?
can anybody help me out with this problem?
i need to implement the functions of inserting,searching and deleting into a dictionary using the concept of balanced trees in c++. could anyone help me out with the coding?
推荐答案
您正在寻找 ^ ]
我从Knuth的描述中写了一次-不太繁琐,只需确保您为此编写了良好的测试工具
搜索是标准的Btree遍历,插入和删除是昂贵且最复杂的,因为它们涉及平衡树
you''re looking for AVL trees[^]
I wrote one once from Knuth''s description - it''s not too onerous, just make sure you write a good test-harness for it
Searching is standard Btree traversal, insertion and deletion are costly and the most complicated, because they involve balancing the tree
这篇关于在C ++中使用平衡树的字典实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文