checks if node is the root of a binary search tree.

c++ c++14

44 观看

1回复

3 作者的声誉

i Need to Write a function that takes a Node and checks if this node is the root of a binary search tree ,if any one have the code for this problem or at least the algorithm.

作者: GHOST 的来源 发布者: 2017 年 12 月 27 日

回应 1


0

98627 作者的声誉

决定

The algorithm needs to do in-order traversal and test whether the previous visited node is less-then-or-equal (or whatever the search tree predicate is) to the current node.

作者: Maxim Egorushkin 发布者: 2017 年 12 月 27 日
32x32