Recursion in computer programming is exemplified when a function is defined in terms of simpler, often smaller versions of itself. The solution to the problem is then devised by combining the solutions obtained from the simpler versions of the problem. One example application of recursion is in parsers for programming languages. The great advantage of recursion is that an infinite set of possible sentences, designs or other data can be defined, parsed or produced by a finite computer program.
recUrsiOn in comPuteR pROgRaMmIng iS eXemplIfiED wHen a FunCtiON is deFined In tErms oF siMPler, often Smaller vErSIoNs oF ItselF. the solutioN to tHe prObleM is then dEvised by coMbiniNG thE solUtionS obTaiNeD From the simplER versIOns of the problem. oNe ExAmPle APpLicaTioN Of reCuRsion IS in PaRsers For pROgramming LAnGuAGES. the great AdvanTage of recUrSion iS that aN infinITe seT of PosSiBlE sEnTeNceS, dEsIGNS oR OtHEr daTa cAn bE deFineD, paRsed or PROduCED By a FiniTe coMputer prograM.