@lydiahallie/

UnnaturalUnsteadyArraylist

Nodejs

No description

fork
loading
Files
  • index.js

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.47553928251585886","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"CmZ1bmN0aW9uIGluc2VydGlvblNvcnQoYXJyYXkpIHsKICBmb3IgKGxldCBpID0gMDsgaSA8IGFycmF5Lmxlbmd0aDsgaSsrKSB7CiAgICBsZXQgaiA9IGkgLSAxCiAgICB3aGlsZSAoaiA+PSAwICYmIGFycmF5W2pdID4gYXJyYXlbaV0pIHsKICAgICAgYXJyYXlbaiArIDFdID0gCiAgICB9CiAgfQp9CgppbnNlcnRpb25Tb3J0KFs5LCA1LCAxMCwgOCwgMl0pIC8vIFsyLCA1LCA4LCA5LCAxMF0="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
function insertionSort(array) {
  for (let i = 0; i < array.length; i++) {
    let j = i - 1
    while (j >= 0 && array[j] > array[i]) {
      array[j + 1] = 
    }
  }
}

insertionSort([9, 5, 10, 8, 2]) // [2, 5, 8, 9, 10]
node v10.16.0