v1
10/21/2021 by darryl -00
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
const qs = ([x, ...xs]) => (
  x !== undefined ?
    [
      ...qs(xs.filter(s => s <= x)),
      x,
      ...qs(xs.filter(b => b > x))
    ]
    : []
);

const qs2 = (xs) => (
  xs.length > 0 ?
    xs[0] !== undefined ?
      [
        ...qs2(xs.slice(1).filter(s => s <= xs[0])),
        xs[0],
        ...qs2(xs.slice(1).filter(b => b > xs[0]))
      ]
      : qs2(xs.slice(1))
    : []
);

const arr = Array.from({length: 100}, () => Math.round(Math.random() * 100));
delete caserun single casemove downdrag and drop case


ready



const sorted_array = qs(arr);
delete caserun single casemove upmove downdrag and drop case


ready



const sorted_array = qs2(arr);
delete caserun single casemove updrag and drop case


ready



const sorted_array = [...arr].sort()
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN