我如何合并两个二叉树 [英] How i can merge two binary trees

查看:21
本文介绍了我如何合并两个二叉树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个二叉树,我想合并它们.我的第一个问题是我们是否可以合并两个二叉树,如果是,我执行合并操作的效率如何以及我可以执行合并操作的各种方法是什么...?

I have two binary trees and I want to merge them. My first question is that whether we can merge two binary trees and if yes how efficiently I can perform the merge operations and what are the various ways i can perform the merging operations. ..?

推荐答案

不考虑效率这个答案可能有效 结合两棵二叉树的算法? .如果排序或平衡,关于效率的讨论 如何有效地合并两个 BST?连接/合并/加入两棵 AVL 树

Not considering efficiency this answer may work Algorithm of combining two binary trees? . If sorted or balanced, discussion on efficiency in How to merge two BST's efficiently? and Concatenating/Merging/Joining two AVL trees

这篇关于我如何合并两个二叉树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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