在C ++中使用平衡树的字典实现 [英] dictionary implementation using balanced tree in c++

查看:71
本文介绍了在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?

推荐答案

您正在寻找
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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆