Advantages & Disadvantages of Recursion..

Hi!!! friends ;-)

1)How stack is useful in recursion?
2)Advantages and Disadvantages of recursion??

Replies

  • Manish Goyal
    Manish Goyal
    Re: Recursion..

    see recursion means a function calls repeatedly

    It uses system stack to accomplish it's task....as stack uses last in last out approach
    and when a function is called the controlled is moved to where function is defined which has it is stored in memory with some address this address is stored in stack

    second recursion is very interesting ....
    it reduces a time complexity of a program for eg
    say you have created a program for mergesort which uses recursion ie divide and conquer approach and insertion sort which uses normal programming
    now from time complexity point of view you will choose only merge sort to sort a array
    as it has time complexity of nlogn
    and insertion sort has n*n
    2:-it haS disadvantage also
    it involves a lot of memory wastage
    and very much typical concept to understand

You are reading an archived discussion.

Related Posts

in one cylinder we make partition and use two piston in one anoter side . its possible ? 😕 its give good performance ?
Can be considered as a type of Adhoc network.But seeing the technical complexities involved and various topologies involved , WMN can be rather considered as a super set of Adhoc...
can anyone explain me why dot net is famous now a days..?? why it is prefferable..?? what other features it provide??😁
Hey guys can you share links where I can apply job as a Telecommunication engineer? I am looking forward to find job in Europe or USA. Any kind of help...
Hi to all members, i'm searching for latest ieee projects in image processing. If any one having idea about it please help me.