How to find empty nodes in binary tree?
Moderator: General Moderators
How to find empty nodes in binary tree?
I want to find all empty nodes present in a binary tree. The tree is stored in DB in a table with following fields : NodeName, ParentID, ParentSide.
Example :
A
/ \
B empty node
/ \
B1 empty node
/ \
empty node empty node
How can i find all this nodes?
Help please.
Example :
A
/ \
B empty node
/ \
B1 empty node
/ \
empty node empty node
How can i find all this nodes?
Help please.
Re: How to find empty nodes in binary tree?
What have you tried so far?
There are 10 types of people in this world, those who understand binary and those who don't
Re: How to find empty nodes in binary tree?
We're not prepared to do your coursework for you.
Re: How to find empty nodes in binary tree?
No, you don't have to. I have solved it myself.Jenk wrote:We're not prepared to do your coursework for you.
Anyway thank for your reply!
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: How to find empty nodes in binary tree?
So you admit your guilty of submitting course material on a forum to have someone else hopefully solve it? I'm not sure if thats intelligence or just lazy.No, you don't have to. I have solved it myself.
Re: How to find empty nodes in binary tree?
"Solved it" by copying an answer from another forum no less 
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: How to find empty nodes in binary tree?
Probably, sad but true. 
Re: How to find empty nodes in binary tree?
After all the forum are made to help each other.PCSpectra wrote:So you admit your guilty of submitting course material on a forum to have someone else hopefully solve it? I'm not sure if thats intelligence or just lazy.No, you don't have to. I have solved it myself.
But genus like u, can only see the negative part, where most the people are lazy.
> "someone else hopefully solve it" - someone else is not U.
If u are a programmer, than u must have gone thru a phase in programming, when u feel that can't solve the problem and leave it or ask for help from other. After some time, a new idea pop up ur mind and that it. It is solved.
Re: How to find empty nodes in binary tree?
U must a great programmer who don't take any help from other and You solve ur programing problems all by urself.Jenk wrote:"Solved it" by copying an answer from another forum no less
Re: How to find empty nodes in binary tree?
While he is a great programmer, he is also a great "fisherman"askbapi wrote:U must a great programmer who don't take any help from other and You solve ur programing problems all by urself.Jenk wrote:"Solved it" by copying an answer from another forum no less
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
There are 10 types of people in this world, those who understand binary and those who don't
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Re: How to find empty nodes in binary tree?
We have all seen our fare share of college students asking for answers to problems on these boards and others, nothing new there. The way you asked the question, indicated you were doing the same thing. Had you put a little effort into the question, like explaining what you had done hitherto, you might have received a different reply. You probalby wouldnèt have got a reply at all actually.U must a great programmer who don't take any help from other and You solve ur programing problems all by urself
1. That topic is not trivial
2. That topic is not interesting to most developers
Cheers,
Alex
Re: How to find empty nodes in binary tree?
This thread was not asking for help, it was asking for the answer to be given for you, without you even trying nor learning from it.askbapi wrote:U must a great programmer who don't take any help from other and You solve ur programing problems all by urself.Jenk wrote:"Solved it" by copying an answer from another forum no less
Re: How to find empty nodes in binary tree?
PCSpectra wrote:1. That topic is not trivial
2. That topic is not interesting to most developers
That's what interesting about this thread - I feel like I'll refuse to answer "Headers already sent ... bla-bla"-like questions, but I'm willing to answer questions like the one in this thread. I see it happens to all "advanced" members in this forum - they do refuse to answer the "usual-suspects" questions, but will answer "trivial" and not so "usual" questions.
There are 10 types of people in this world, those who understand binary and those who don't
Re: How to find empty nodes in binary tree?
My reasons for not answering this thread's question should be clear, but in case they are not:
The OP has not made any effort to answer this themselves yet. We (I) like to help people to learn, not provide an answer for their exam paper for them to copy.
This is such an amazingly common question in exams/course work. There is even an entire Wikipedia page dedicated to it, furhter demonstrating that the OP hasn't even bothered to interpret the problem, merely scan the web for a copy/paste answer.
The OP has not made any effort to answer this themselves yet. We (I) like to help people to learn, not provide an answer for their exam paper for them to copy.
This is such an amazingly common question in exams/course work. There is even an entire Wikipedia page dedicated to it, furhter demonstrating that the OP hasn't even bothered to interpret the problem, merely scan the web for a copy/paste answer.
Re: How to find empty nodes in binary tree?
So how about posting your solution?