What's the difference between a parent and predecessor node in binary search tree?

Reply

Join Date: Jul 2009
Posts: 35
Reputation: iamsmooth is an unknown quantity at this point 
Solved Threads: 0
iamsmooth iamsmooth is offline Offline
Light Poster

What's the difference between a parent and predecessor node in binary search tree?

 
0
  #1
22 Days Ago
Just wondering what the difference is. I don't think I need to post my code, but basically for my assignment, I have stubs for a binary search tree. There are nodes created in the constructor, and among them are:

Node parent
Node predecessor
Node sucessor
Node right
Node left

Is there a point in predecessor and sucessor? Seems to me it would work with just parent, right, and left, no?

Thanks
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1,566
Reputation: BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all 
Solved Threads: 196
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso
 
0
  #2
22 Days Ago
Yes, it would work - you are correct. See here for definitions of predecessor and successor.
Out.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 332
Reputation: quuba is on a distinguished road 
Solved Threads: 53
quuba quuba is offline Offline
Posting Whiz
 
0
  #3
21 Days Ago
Do not forget also the
Node root
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC