what is the algorithm in this problem..

This is a discussion on what is the algorithm in this problem.. within the C Programming forums, part of the General Programming Boards category; i need to write a recursive function which finds the smallest number in a tree which is bigger then the ...

  1. #1
    Banned
    Join Date
    Jul 2009
    Posts
    46

    what is the algorithm in this problem..

    i need to write a recursive function which finds the smallest number in a tree which is bigger
    then the given number

    ??

  2. #2
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,758
    Show some effort. The way you ask questions reminds me of someone else. No one wanted to answer his questions cause he didn't want to write anything himself and take all the credit.

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    457
    loop over the tree
    If the number you are looking at is larger than the number you are comparing too, but smaller than the smallest number you have found so far, store it.
    Repeat

    That's how you would do it iteratively, now you do the recursion.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. data mamgment problem (algorithm)
    By cfan in forum C Programming
    Replies: 0
    Last Post: 08-02-2009, 01:07 PM
  2. Implement of a Fast Time Series Evaluation Algorithm
    By BiGreat in forum C Programming
    Replies: 7
    Last Post: 12-04-2007, 02:30 AM
  3. Dijkstra algorithm problem.
    By apacz in forum C++ Programming
    Replies: 5
    Last Post: 05-28-2005, 05:16 PM
  4. Simple algorithm problem
    By stodd04 in forum C Programming
    Replies: 11
    Last Post: 03-04-2005, 11:08 AM
  5. Algorithm question
    By PJYelton in forum C++ Programming
    Replies: 2
    Last Post: 10-28-2002, 10:52 AM

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