Comment

Comment by mqsiuser

Hoare writes in his (famous) paper on quicksort (in 1962): "We'd implement our own recursion schema for perf reasons"

Recursion is just a tree.

Calling a function/procedure is expensive (in memory and run-time).

Create a tree (e.g. linked list), base your recursion on that!

You are not at university anymore, where you look at naive implementations for the sake of learning.

Spoiler: I (actually do) resolve (function-call) recursion to (tree-based) recursion when I feel like I want to.

Downvoters pls explain.

parent mqsiuser 12 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton