Thread: what is the algorithm in this problem..

  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
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    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
    486
    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, 12: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, 04: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