Subj : Re: Are recursive functions ever needed? To : comp.programming From : John Date : Sun Oct 02 2005 03:05 pm "Ben Pfaff" wrote in message news:87u0g06izs.fsf@benpfaff.org... > "John" writes: > >> "Tatu Portin" wrote in message >> news:z%x%e.451$nZ1.352@read3.inet.fi... >> [snip] >>> Well, my problem here seems to be lack of good examples where recursion >>> is >>> needed. Would anybody provide some? >> >> XML parser. >> Binary tree. >> traversing a directory tree >> web crawler > > Recursion isn't *needed* in any of those cases. For example, > regarding binary trees, take a look at GNU libavl, which doesn't > use recursion at all. By needed .. do you mean is it the only way of doing it? You're right I'm sure it isn't *needed*. But IMHO, it's definitely the simplest solution to those problems. .