On Fri, 19 Jun 1998, Glynn Clements wrote:

->Also, many problems which could be solved by either branched recursion
->or iteration (tail-end recursion) can be solved more efficiently by
->branched recursion; typically the recursive approach is O(log(n))
->whereas the iterative approach is O(n).
->
->Sorting algorithms are a good example. The `beginner's' algorithms
->(e.g. insertion sort, selection sort) have an iterative structure, and
->are O(n^2). The `real-world' algorithms (e.g. quick sort, heap sort),
->have a divide-and-conquer (i.e. branched recursive) structure, and are
->O(n.log(n)).

it's too early in the afternoon for this :)

-[[EMAIL PROTECTED]]-------------------------------------------------
Http://x-map.home.ml.org                  Mailto : [EMAIL PROTECTED]
---[Quote Of The Day]----------------------------------------------------------
Old programmers never die.  They just branch to a new address.
-------------------------------------------------------------------------------

Reply via email to