looking for algoritm for this problem..

This is a discussion on looking for algoritm for this problem.. within the C Programming forums, part of the General Programming Boards category; i have a binary tree. and i need to build a function which gets the root and the level integer. ...

  1. #1
    Banned
    Join Date
    Oct 2008
    Posts
    1,535

    looking for algoritm for this problem..

    i have a binary tree.
    and i need to build a function which gets the root and the level integer.
    and it needs to return how many nodes are from the given level till the final level
    (the leaves level)

    each node has left ,right ,int value

  2. #2
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    How many times do you have to be told? These are the basic guidelines for the forum - you've seen this hundreds, possibly thousands of times.

    1) Make an attempt. If you don't know where to start, try searching.

    2) Binary trees have been discussed countless times on this forum - you have no excuse for not even finding a place to start

    3) Once you've made an attempt, and you have a specific problem that cannot be resolved by looking in the documentation, post the details: error messages, problems, and just as important: what you have done to solve the problem.

  3. #3
    Banned
    Join Date
    Oct 2008
    Posts
    1,535
    i dont want that you will write me the code

    i want the basic idea

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    250
    Quote Originally Posted by transgalactic2 View Post
    i dont want that you will write me the code

    i want the basic idea
    Here's your basic idea:

    you have a binary tree.
    you build a function which gets the root and the level integer.
    you find the final level integer
    you subtract the two and you get your answer
    then you get yourself a book on grammar

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21