Data Structure for self Learning
Data Structure - Recursion Basics Some computer programming languages allow a module or function to call itself. This technique is known as recursion. In recursion, a function α either calls itself directly or calls a function β that in turn calls the original function α . The function α is called recursive function. in Python Recursion work upto (1000 by Default) Example − a function calling itself. int function ( int value ) { if ( value < 1 ) return ; function ( value - 1 ); printf ( "%d " , value ); } Example − a function that calls another function which in turn calls it again. int function1 ( int value1 ) { if ( value1 < 1 ) return ; function2 ( value1 - 1 ); printf ( "%d " , value1 ); } int function2 ( int value2 ) { function1 ( value2 ); } Properties A recursive function can go infinite like a loop. To avoid infinite running of recursive f...