Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Algorithm Crisis

    VB6

    Guys I have a really big challenge set to me. I have been asked by my cousin to generate an iterative algorithm with (FOR NEXT Loop) that undertakes the same task as the following recursive algorithm.

    This is the recursive algorithm:

    Function Mystery (X(), N)

    IF N=1 THEN
    Mystery = 1
    ELSE
    Temp = Mystery(X(), N-1)
    IF X(N)>= X(Temp) THEN
    Mystery = N
    ELSE
    Mystery = Temp
    ENDIF
    ENDIF

    End Function Mystery


    I will be extremely grateful if you can help me with this..

    Thanks in advance...

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try writing it yourself then ask if you need help on specific problems.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •