How to count the number of right children in a binary tree?

Posted by flopex on Stack Overflow See other posts from Stack Overflow or by flopex
Published on 2010-04-14T04:30:27Z Indexed on 2010/04/14 4:33 UTC
Read the original article Hit count: 251

How to count the number of right children in a binary tree?

This means that I only want the children marked as right.

Ex. (Left | Right)

F(Root)

G | H

T U | I J

The right children would be U,H,and J.

What would be the algorithm to find these.

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about java