Re: Binary search tree



sarajan82@xxxxxxxxx wrote:

Given a binary search tree and a number n, how can we find the
smallest node of the tree greater than n and the largest node
smaller than n?

For example for the following binary search tree where 5 is root
and 4 is the left and 6 the right child, for an input of 5,
4 and 6 will be output:

5
4 6

You omitted the email address of your instructor. This would
enable much easier direct submission of your homework. There is
also a fee involved when doing others homework.

--
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

.