dimanche 7 décembre 2014

Check if current node is a leaf


Vote count:

0




I want to check if the array index I'm looking at ( array[i] ) is a leaf in the binary tree I'm looking at.


Basically I want to be able to say:



if (this is a leaf node) {
do this
}
else{
do that
}


I feel this is a very simple problem if the binary tree is a complete tree.


Thank you.



asked 31 secs ago







Check if current node is a leaf

Aucun commentaire:

Enregistrer un commentaire