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 :D

Recommended Answers

All 2 Replies

Yes, it would work - you are correct. See here for definitions of predecessor and successor.

Do not forget also the

Node root

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.