i have done like this is it correct or not??
public int less(int n) // return how many number are less than n appear in tree
{
if(parent == null)
return 0;
else
if(...
Type: Posts; User: asdee
i have done like this is it correct or not??
public int less(int n) // return how many number are less than n appear in tree
{
if(parent == null)
return 0;
else
if(...
my steps for first method
search for numbers that is less than n in tree
then count these number
and my steps for the second acutlly i do not understand this method so i can not put steps for it...
i have write in public int less (int n)
{if (parent == null)
return 0; // this mean that if the tree is empty return 0
else
count the numbers that are less than n
}
--- Update ---
this...
yes I am confuse about how to write these method
help me please ??
thanks in advance
--- Update ---
i have write in public int less (int n)
{if (parent == null)
return 0; // this mean that...
I comment beside each method what it should return ???
I have two methods which are
public int less(int n)
public int nth (int n)
I can not solve them can help me please??
this is my code
public class BST
{ private BTNode<Integer> root;