本文介绍了给定二叉搜索树及其order属性,返回位于'x'位置的元素。 (递归的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑到二叉搜索树的order属性,我需要返回给定'x'位置的元素。该函数被命名为'FindXelement(natural x,binary b)',返回位于'x'位置的节点。 (必须递归完成)我有一些辅助功能,如Height_of_Tree,Min,Max和其他功能但无法执行该功能。任何的想法?

谢谢



我的尝试:



使用aux函数和递归

Considering the order property of binary search trees I need to return an element given the 'x' place. The function is named 'FindXelement(natural x, binary b)' returning a node in such position 'x'. (must be done recursively) Ive got some aux functions such as Height_of_Tree, Min, Max and others but wasnt able to do that function. any idea?
Thanks

What I have tried:

using aux functions and recursion

推荐答案



这篇关于给定二叉搜索树及其order属性,返回位于'x'位置的元素。 (递归的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 20:39