I have been revising algorithms for some days. Actually , i am not aware that iterative versions of the algorithms do exist but why they are not popular as their recursive counterparts.
Even the Arrays.sort method in java implements recursive quick sort.I heard that recursion causes overhead in maintaining the stack frames for each method call.
for e.g: Iterative version for merge sort is even simple. It first sort the adjacent elements and then the sorted pairs , so on.
I posted this question on StackOverflow too: but dint get a convincing answer.What are your views about this??
memory is pretty cheap these days. My father used to tell me about when they paid basically $1 PER BYTE of memory. Today, I can run into just about any store and buy a 4GB thumb drive for under $15 bucks. It's usually not something to worry about. even my cell phone has a 4GB chip in it.
Never ascribe to malice that which can be adequately explained by stupidity.