Confused Tree help
I'm a beginner programmer learning about trees currently. I have a question about my confused pointer checker for my tree. The rules that need to be followed are as such:
●The root node’s confused pointer is always null.
● Nodes at odd depth have confused pointers pointing to their parent.
● Nodes at even depth have confused pointers pointing to a random node at the same
depth. If there are no other nodes at that depth, it points to null.
currently this is what I have:
So, the issue that i'm coming across is that it always keeps returning false when it should. I've combed through this for a hot minute and I still haven't found the issue.
3 Replies
⌛
This post has been reserved for your question.
Hey @freekbird! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
What can I do to fix this so it actually works properly
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.