a recursion function help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • M Hayouka

    a recursion function help

    hi

    can anybody give me a web that I can learn about a recursion function

    I don't really understand it

  • Thomas Matthews

    #2
    Re: a recursion function help

    M Hayouka wrote:[color=blue]
    > hi
    >
    > can anybody give me a web that I can learn about a recursion function
    >
    > I don't really understand it[/color]

    Try using a web search engine, such as http://www.google.com

    --
    Thomas Matthews

    C++ newsgroup welcome message:

    C++ Faq: http://www.parashift.com/c++-faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.l earn.c-c++ faq:

    Other sites:
    http://www.josuttis.com -- C++ STL Library book

    Comment

    • M Hayouka

      #3
      can u explain recursion

      ???????




      "Thomas Matthews" <Thomas_Matthew sHatesSpam@sbcg lobal.net> wrote in message
      news:k316b.5046 $1x6.3575@newss vr33.news.prodi gy.com...[color=blue]
      > M Hayouka wrote:[color=green]
      > > hi
      > >
      > > can anybody give me a web that I can learn about a recursion function
      > >
      > > I don't really understand it[/color]
      >
      > Try using a web search engine, such as http://www.google.com
      >
      > --
      > Thomas Matthews
      >
      > C++ newsgroup welcome message:
      > http://www.slack.net/~shiva/welcome.txt
      > C++ Faq: http://www.parashift.com/c++-faq-lite
      > C Faq: http://www.eskimo.com/~scs/c-faq/top.html
      > alt.comp.lang.l earn.c-c++ faq:
      > http://www.raos.demon.uk/acllc-c++/faq.html
      > Other sites:
      > http://www.josuttis.com -- C++ STL Library book
      >[/color]

      Comment

      • Ivan Vecerina

        #4
        Re: can u explain recursion


        "M Hayouka" <Hayouka@bezeqi nt.net> wrote in message
        news:3f58a8ef$1 @news.bezeqint. net...
        | > > can anybody give me a web that I can learn about a recursion function
        | > >
        | > > I don't really understand it

        Well, the definition of recursion in programming terms is pretty simple:
        whenever a function calls itself, it is a recursive function.

        Usually, this technique is used to break-down a problem
        where you need to repeat the same operation multiple
        times on different inputs, until a certain goal
        has been found (there has to be an end-condition,
        or you have infinite recursion ==> program crash).

        Examples are the traversal of binary trees, or the
        computations of some mathematical functions:

        unsigned long factorial( long i )
        {
        if(i<=1) return 1;
        else return i * factorial(i-1);
        }

        If you are confused by what a 'factorial' or a 'binary tree' is,
        you probably should read about these concepts first.


        I hope this helps as a start. Note also that 'recursion' is
        definitely not a C++-specific question. In the first place,
        it is a common mathematical concept...


        hth
        --
        http://www.post1.com/~ivec <> Ivan Vecerina




        Comment

        • M Hayouka

          #5
          Re: can u explain recursion

          Thank you very much,


          "Ivan Vecerina" <ivec@myrealbox .com> wrote in message
          news:3f58cd30$1 @news.swissonli ne.ch...[color=blue]
          >
          > "M Hayouka" <Hayouka@bezeqi nt.net> wrote in message
          > news:3f58a8ef$1 @news.bezeqint. net...
          > | > > can anybody give me a web that I can learn about a recursion[/color]
          function[color=blue]
          > | > >
          > | > > I don't really understand it
          >
          > Well, the definition of recursion in programming terms is pretty simple:
          > whenever a function calls itself, it is a recursive function.
          >
          > Usually, this technique is used to break-down a problem
          > where you need to repeat the same operation multiple
          > times on different inputs, until a certain goal
          > has been found (there has to be an end-condition,
          > or you have infinite recursion ==> program crash).
          >
          > Examples are the traversal of binary trees, or the
          > computations of some mathematical functions:
          >
          > unsigned long factorial( long i )
          > {
          > if(i<=1) return 1;
          > else return i * factorial(i-1);
          > }
          >
          > If you are confused by what a 'factorial' or a 'binary tree' is,
          > you probably should read about these concepts first.
          >
          >
          > I hope this helps as a start. Note also that 'recursion' is
          > definitely not a C++-specific question. In the first place,
          > it is a common mathematical concept...
          >
          >
          > hth
          > --
          > http://www.post1.com/~ivec <> Ivan Vecerina
          >
          >
          >
          >[/color]

          Comment

          Working...