Results 1 to 3 of 3

Thread: recursion

  1. #1
    ravian is offline Senior Member
    Join Date
    Nov 2007
    Posts
    115
    Rep Power
    0

    Default recursion

    I have a task in hand and there are two options.

    Option 1 : Do this task in a simple way
    Option 2: Write a method and call in recursively.

    Both are producing the required results. My question is, does recursion causes performance issues?

    Please advice.

    Thanks.

  2. #2
    ShoeNinja's Avatar
    ShoeNinja is offline Senior Member
    Join Date
    Oct 2007
    Posts
    124
    Rep Power
    0

    Default

    I always thought that recursion does take up a little bit more memory because it has to keep track of all the pointers. Other than that, I would think that it has the same performance.

  3. #3
    ravian is offline Senior Member
    Join Date
    Nov 2007
    Posts
    115
    Rep Power
    0

    Default

    So the bottom line is, recursion takes more memory.
    Thanks.

Similar Threads

  1. Help With Recursion
    By andrew777 in forum New To Java
    Replies: 1
    Last Post: 03-29-2008, 12:51 PM
  2. recursion
    By kdeighan in forum New To Java
    Replies: 3
    Last Post: 01-25-2008, 09:48 PM
  3. Recursion
    By bozovilla in forum Advanced Java
    Replies: 3
    Last Post: 01-07-2008, 04:53 PM
  4. Help with recursion
    By scts102 in forum New To Java
    Replies: 1
    Last Post: 11-19-2007, 10:07 PM
  5. Recursion in java
    By lenny in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 06:23 AM

Posting Permissions

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