local function qsort (x, l, u, f) if l < u then local m = (math.random (u - (l - 1)) + l) - 1 x[l], x[m] = x[m], x[l] local t = x[l] m = l local i = l + 1 while i <= u do if f (x[i], t) then m = m + 1 x[m], x[i] = x[i], x[m] end i = i + 1 end x[l], x[m] = x[m], x[l] local __v4x, __v6l, __v3u, __v5f = x, l, m - 1, f if __v6l < __v3u then local __v2m = (math.random (__v3u - (__v6l - 1)) + __v6l) - 1 __v4x[__v6l], __v4x[__v2m] = __v4x[__v2m], __v4x[__v6l] local __v7t = __v4x[__v6l] __v2m = __v6l local __v1i = __v6l + 1 while __v1i <= __v3u do if __v5f (__v4x[__v1i], __v7t) then __v2m = __v2m + 1 __v4x[__v2m], __v4x[__v1i] = __v4x[__v1i], __v4x[__v2m] end __v1i = __v1i + 1 end __v4x[__v6l], __v4x[__v2m] = __v4x[__v2m], __v4x[__v6l] qsort (__v4x, __v6l, __v2m - 1, __v5f) qsort (__v4x, __v2m + 1, __v3u, __v5f) end local __v17x, __v10l, __v9u, __v15f = x, m + 1, u, f if __v10l < __v9u then local __v14m = (math.random (__v9u - (__v10l - 1)) + __v10l) - 1 __v17x[__v10l], __v17x[__v14m] = __v17x[__v14m], __v17x[__v10l] local __v21t = __v17x[__v10l] __v14m = __v10l local __v19i = __v10l + 1 while __v19i <= __v9u do if __v15f (__v17x[__v19i], __v21t) then __v14m = __v14m + 1 __v17x[__v14m], __v17x[__v19i] = __v17x[__v19i], __v17x[__v14m] end __v19i = __v19i + 1 end __v17x[__v10l], __v17x[__v14m] = __v17x[__v14m], __v17x[__v10l] local __v18x, __v13l, __v16u, __v11f = __v17x, __v10l, __v14m - 1, __v15f if __v13l < __v16u then local __v12m = (math.random (__v16u - (__v13l - 1)) + __v13l) - 1 __v18x[__v13l], __v18x[__v12m] = __v18x[__v12m], __v18x[__v13l] local __v20t = __v18x[__v13l] __v12m = __v13l local __v8i = __v13l + 1 while __v8i <= __v16u do if __v11f (__v18x[__v8i], __v20t) then __v12m = __v12m + 1 __v18x[__v12m], __v18x[__v8i] = __v18x[__v8i], __v18x[__v12m] end __v8i = __v8i + 1 end __v18x[__v13l], __v18x[__v12m] = __v18x[__v12m], __v18x[__v13l] qsort (__v18x, __v13l, __v12m - 1, __v11f) qsort (__v18x, __v12m + 1, __v16u, __v11f) end qsort (__v17x, __v14m + 1, __v9u, __v15f) end end end x = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" } local __v150x = x local __v107n = 1 while __v150x[__v107n] do __v107n = __v107n + 1 end __v107n = __v107n - 1 local __v155m, __v140x = "original", __v150x io.write (__v155m, "\n ") local __v158i = 1 while __v140x[__v158i] do io.write (__v140x[__v158i]) __v158i = __v158i + 1 if __v140x[__v158i] then io.write "," end end io.write "\n" local __v139x, __v112l, __v109u, __v98f = __v150x, 1, __v107n, function (__v150x, __v167y) return __v150x < __v167y end if __v112l < __v109u then local __v105m = (math.random (__v109u - (__v112l - 1)) + __v112l) - 1 __v139x[__v112l], __v139x[__v105m] = __v139x[__v105m], __v139x[__v112l] local __v161t = __v139x[__v112l] __v105m = __v112l local __v136i = __v112l + 1 while __v136i <= __v109u do if __v98f (__v139x[__v136i], __v161t) then __v105m = __v105m + 1 __v139x[__v105m], __v139x[__v136i] = __v139x[__v136i], __v139x[__v105m] end __v136i = __v136i + 1 end __v139x[__v112l], __v139x[__v105m] = __v139x[__v105m], __v139x[__v112l] local __v122x, __v101l, __v143u, __v135f = __v139x, __v112l, __v105m - 1, __v98f if __v101l < __v143u then local __v144m = (math.random (__v143u - (__v101l - 1)) + __v101l) - 1 __v122x[__v101l], __v122x[__v144m] = __v122x[__v144m], __v122x[__v101l] local __v164t = __v122x[__v101l] __v144m = __v101l local __v145i = __v101l + 1 while __v145i <= __v143u do if __v135f (__v122x[__v145i], __v164t) then __v144m = __v144m + 1 __v122x[__v144m], __v122x[__v145i] = __v122x[__v145i], __v122x[__v144m] end __v145i = __v145i + 1 end __v122x[__v101l], __v122x[__v144m] = __v122x[__v144m], __v122x[__v101l] qsort (__v122x, __v101l, __v144m - 1, __v135f) qsort (__v122x, __v144m + 1, __v143u, __v135f) end local __v126x, __v97l, __v114u, __v96f = __v139x, __v105m + 1, __v109u, __v98f if __v97l < __v114u then local __v120m = (math.random (__v114u - (__v97l - 1)) + __v97l) - 1 __v126x[__v97l], __v126x[__v120m] = __v126x[__v120m], __v126x[__v97l] local __v133t = __v126x[__v97l] __v120m = __v97l local __v115i = __v97l + 1 while __v115i <= __v114u do if __v96f (__v126x[__v115i], __v133t) then __v120m = __v120m + 1 __v126x[__v120m], __v126x[__v115i] = __v126x[__v115i], __v126x[__v120m] end __v115i = __v115i + 1 end __v126x[__v97l], __v126x[__v120m] = __v126x[__v120m], __v126x[__v97l] local __v106x, __v108l, __v146u, __v138f = __v126x, __v97l, __v120m - 1, __v96f if __v108l < __v146u then local __v104m = (math.random (__v146u - (__v108l - 1)) + __v108l) - 1 __v106x[__v108l], __v106x[__v104m] = __v106x[__v104m], __v106x[__v108l] local __v147t = __v106x[__v108l] __v104m = __v108l local __v103i = __v108l + 1 while __v103i <= __v146u do if __v138f (__v106x[__v103i], __v147t) then __v104m = __v104m + 1 __v106x[__v104m], __v106x[__v103i] = __v106x[__v103i], __v106x[__v104m] end __v103i = __v103i + 1 end __v106x[__v108l], __v106x[__v104m] = __v106x[__v104m], __v106x[__v108l] qsort (__v106x, __v108l, __v104m - 1, __v138f) qsort (__v106x, __v104m + 1, __v146u, __v138f) end qsort (__v126x, __v120m + 1, __v114u, __v96f) end end local __v141m, __v160x = "after quicksort", __v150x io.write (__v141m, "\n ") local __v99i = 1 while __v160x[__v99i] do io.write (__v160x[__v99i]) __v99i = __v99i + 1 if __v160x[__v99i] then io.write "," end end io.write "\n" local __v127x, __v152n, __v153f = __v150x, __v107n, function (__v150x, __v167y) return __v167y < __v150x end local __v100i = 1 while __v100i <= __v152n do local __v111m, __v113j = __v100i, __v100i + 1 while __v113j <= __v152n do if __v153f (__v127x[__v113j], __v127x[__v111m]) then __v111m = __v113j end __v113j = __v113j + 1 end __v127x[__v100i], __v127x[__v111m] = __v127x[__v111m], __v127x[__v100i] __v100i = __v100i + 1 end local __v137m, __v123x = "after reverse selection sort", __v150x io.write (__v137m, "\n ") local __v131i = 1 while __v123x[__v131i] do io.write (__v123x[__v131i]) __v131i = __v131i + 1 if __v123x[__v131i] then io.write "," end end io.write "\n" local __v124x, __v166l, __v129u, __v151f = __v150x, 1, __v107n, function (__v150x, __v167y) return __v150x < __v167y end if __v166l < __v129u then local __v132m = (math.random (__v129u - (__v166l - 1)) + __v166l) - 1 __v124x[__v166l], __v124x[__v132m] = __v124x[__v132m], __v124x[__v166l] local __v172t = __v124x[__v166l] __v132m = __v166l local __v117i = __v166l + 1 while __v117i <= __v129u do if __v151f (__v124x[__v117i], __v172t) then __v132m = __v132m + 1 __v124x[__v132m], __v124x[__v117i] = __v124x[__v117i], __v124x[__v132m] end __v117i = __v117i + 1 end __v124x[__v166l], __v124x[__v132m] = __v124x[__v132m], __v124x[__v166l] local __v130x, __v110l, __v149u, __v163f = __v124x, __v166l, __v132m - 1, __v151f if __v110l < __v149u then local __v118m = (math.random (__v149u - (__v110l - 1)) + __v110l) - 1 __v130x[__v110l], __v130x[__v118m] = __v130x[__v118m], __v130x[__v110l] local __v134t = __v130x[__v110l] __v118m = __v110l local __v148i = __v110l + 1 while __v148i <= __v149u do if __v163f (__v130x[__v148i], __v134t) then __v118m = __v118m + 1 __v130x[__v118m], __v130x[__v148i] = __v130x[__v148i], __v130x[__v118m] end __v148i = __v148i + 1 end __v130x[__v110l], __v130x[__v118m] = __v130x[__v118m], __v130x[__v110l] qsort (__v130x, __v110l, __v118m - 1, __v163f) qsort (__v130x, __v118m + 1, __v149u, __v163f) end local __v102x, __v156l, __v165u, __v128f = __v124x, __v132m + 1, __v129u, __v151f if __v156l < __v165u then local __v116m = (math.random (__v165u - (__v156l - 1)) + __v156l) - 1 __v102x[__v156l], __v102x[__v116m] = __v102x[__v116m], __v102x[__v156l] local __v170t = __v102x[__v156l] __v116m = __v156l local __v168i = __v156l + 1 while __v168i <= __v165u do if __v128f (__v102x[__v168i], __v170t) then __v116m = __v116m + 1 __v102x[__v116m], __v102x[__v168i] = __v102x[__v168i], __v102x[__v116m] end __v168i = __v168i + 1 end __v102x[__v156l], __v102x[__v116m] = __v102x[__v116m], __v102x[__v156l] local __v121x, __v125l, __v169u, __v157f = __v102x, __v156l, __v116m - 1, __v128f if __v125l < __v169u then local __v162m = (math.random (__v169u - (__v125l - 1)) + __v125l) - 1 __v121x[__v125l], __v121x[__v162m] = __v121x[__v162m], __v121x[__v125l] local __v171t = __v121x[__v125l] __v162m = __v125l local __v159i = __v125l + 1 while __v159i <= __v169u do if __v157f (__v121x[__v159i], __v171t) then __v162m = __v162m + 1 __v121x[__v162m], __v121x[__v159i] = __v121x[__v159i], __v121x[__v162m] end __v159i = __v159i + 1 end __v121x[__v125l], __v121x[__v162m] = __v121x[__v162m], __v121x[__v125l] qsort (__v121x, __v125l, __v162m - 1, __v157f) qsort (__v121x, __v162m + 1, __v169u, __v157f) end qsort (__v102x, __v116m + 1, __v165u, __v128f) end end local __v119m, __v154x = "after quicksort again", __v150x io.write (__v119m, "\n ") local __v142i = 1 while __v154x[__v142i] do io.write (__v154x[__v142i]) __v142i = __v142i + 1 if __v154x[__v142i] then io.write "," end end io.write "\n"