{"ScriptPreparationCode":"var array = [0, 213, 2, 55312, 322, 1312, 12311123, 54642 ];\r\nfunction quickSort(arr){\r\n if(arr.length \u003C= 1) return arr\r\n const pivot = arr[arr.length - 1]\r\n let left = []\r\n let right = []\r\n for(let i = 0; i \u003C arr.length-1; i\u002B\u002B){\r\n if (arr[i] \u003C pivot) {\r\n left.push(arr[i])\r\n } else {\r\n right.push(arr[i])\r\n }\r\n }\r\n return [].concat(quickSort(left),pivot,quickSort(right))\r\n}\r\nfunction quickSort2(arr){\r\n if(arr.length \u003C= 1) return arr\r\n const pivot = arr.pop()\r\n let left = []\r\n let right = []\r\n while(arr[0]){\r\n if (arr[0] \u003C pivot) {\r\n left.push(arr.shift())\r\n } else {\r\n right.push(arr.shift())\r\n }\r\n }\r\n return [].concat(quickSort(left),pivot,quickSort(right))\r\n}","TestCases":[{"Name":"quickSort","Code":"quickSort(array);","IsDeferred":false},{"Name":"quickSort2","Code":"quickSort2(array);","IsDeferred":false},{"Name":"built in sort","Code":"array.sort(function (a, b) { return a - b });","IsDeferred":false}]}