带回溯的平衡二叉搜索树
我想写一个带有回溯的平衡二叉搜索树算法,你能告诉我吗?我不知道我应该如何实施它。我不需要任何代码,我只需要解释。
I want to write the algorithm of Balanced Binary Search Tree with backtracking would you please guild me about it? I dont know how should I implement it. I dont want any code I need just explanation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您正在寻找自平衡二叉树。我推荐红黑树或AVL 树,它们都非常简单。
还有其他具有类似优势(并且可能更容易实现)的二叉树扩展,因此请查看这些维基百科文章底部的相关链接。
It sounds like you're looking for a self-balancing binary tree. I recommend red-black trees or AVL trees, which are both pretty straightforward.
There are other binary tree extensions with similar strengths (and possibly easier implementations), so check out the related links at the bottom of those wikipedia articles.