while [ix do : + endwhile [jdo : - endif < then : [ ] [ : [ ] [ :wi : + : - end until jif then sort(ljendif then sort(irend end sortprocedure quicksortbegin sort( - end quicksort procedure sort activates itself recursively such use of recursion in algorithms is very powerful tool and will be discussed further in chap in some programming languages of older proveniencerecursion is disallowed for certain technical reasons we will now show how this same algorithm can be expressed as non-recursive procedure obviouslythe solution is to express recursion as an iterationwhereby certain amount of additional bookkeeping operations become necessary the key to an iterative solution lies in maintaining list of partitioning requests that have yet to be performed after each steptwo partitioning tasks arise only one of them can be attacked directly by the subsequent iterationthe other one is stacked away on that list it isof courseessential that the list of requests is obeyed in specific sequencenamelyin reverse sequence this implies that the first request listed is the last one to be obeyedand vice versathe list is treated as pulsating stack in the following nonrecursive version of quicksorteach request is represented simply by left and right index specifying the bounds of the partition to be further partitioned thuswe introduce two array variables lowhighused as stacks with index the appropriate choice of the stack size will be discussed during the analysis of quicksort procedure nonrecursivequicksortconst var ijlrsintegerxwitemlowhigharray of integer(*index stack*begin : low[ : high[ : - repeat (*take top request from stack* :low[ ] :high[ ]dec( )repeat (*partition [la[ ]* :lj :rx : [( +rdiv ]repeat while [ix do : + endwhile [jdo : - endif < then : [ ] [ : [ ] [ :wi : + : - end until jif then (*stack request to sort right partition*inc( )low[ :ihigh[ : (adens _sorts *