Diff of /Tests/quicksort.sis [000000] .. [32eb06] Maximize Restore

  Switch to side-by-side view

--- a
+++ b/Tests/quicksort.sis
@@ -0,0 +1,28 @@
+define	Main
+
+type Info = array[ integer ]
+
+function Main (	Data : Info returns Info )
+
+    function Split (Data : Info  returns Info, Info, Info )
+	for E in Data
+	returns	array of E when E < Data[ 1 ]
+		array of E when E = Data[ 1 ]
+		array of E when E > Data[ 1 ]
+	end for
+    end function
+
+    % routine body
+    %
+
+    if array_size( Data ) > 2 then
+       let
+          L, Middle, R := Split( Data )
+       in
+	  Main( L ) || Middle || Main( R )
+       end let
+    else
+       Data
+    end if
+
+end function % quicksort