Thread: leaves on a binary tree

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    > if(p->left !=NULL && p->right !=NULL)
    Yeah, you missed the possibility that one of the branches could be NULL without the other branch being NULL.
    So you only print nodes which have both children present.

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    78

    okay friends how about a small hint

    okay buds I give up can anybody just send me in the right direction at all with this whole leaf thing. I'm lost all of the algorithms I've tried fail miserably. So please be merciful and throw me a bone here.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 11-04-2006, 11:07 AM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 09:40 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 10:45 PM