mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-03-17 03:11:01 +00:00
Delete tests/3_lis/outputs directory
This commit is contained in:
@@ -1,13 +0,0 @@
|
|||||||
async function findLISLength(nums) {
|
|
||||||
if (!nums?.length) return 0;
|
|
||||||
const { bisectLeft } = await import('https://cdn.jsdelivr.net/npm/d3-array@3/+esm');
|
|
||||||
const tails = [];
|
|
||||||
for (const n of nums) {
|
|
||||||
const i = bisectLeft(tails, n);
|
|
||||||
i < tails.length ? tails[i] = n : tails.push(n);
|
|
||||||
}
|
|
||||||
return tails.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 3.101s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
async function findLISLength(nums) {
|
|
||||||
const { bisectLeft } = await import("https://cdn.jsdelivr.net/npm/d3-array/+esm");
|
|
||||||
const tails = [];
|
|
||||||
for (const n of nums) {
|
|
||||||
const i = bisectLeft(tails, n);
|
|
||||||
i === tails.length ? tails.push(n) : tails[i] = n;
|
|
||||||
}
|
|
||||||
return tails.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 3.057s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
async function findLISLength(arr) {
|
|
||||||
const { bisectLeft } = await import('https://cdn.skypack.dev/d3-array');
|
|
||||||
|
|
||||||
if (!arr?.length) return 0;
|
|
||||||
|
|
||||||
const tails = [];
|
|
||||||
|
|
||||||
for (const num of arr) {
|
|
||||||
const idx = bisectLeft(tails, num);
|
|
||||||
tails[idx] = num;
|
|
||||||
}
|
|
||||||
|
|
||||||
return tails.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 2.177s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
async function findLISLength(nums) {
|
|
||||||
if (!nums?.length) return 0;
|
|
||||||
|
|
||||||
const { bisectLeft } = await import("https://cdn.skypack.dev/d3-array");
|
|
||||||
|
|
||||||
const tails = [];
|
|
||||||
|
|
||||||
for (const n of nums) {
|
|
||||||
const i = bisectLeft(tails, n);
|
|
||||||
tails[i] = n;
|
|
||||||
}
|
|
||||||
|
|
||||||
return tails.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 1.943s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
async function findLISLength(arr) {
|
|
||||||
const d3 = await import('https://esm.sh/d3-array@3.2.4');
|
|
||||||
const tails = [];
|
|
||||||
for (const num of arr) {
|
|
||||||
const i = d3.bisectLeft(tails, num);
|
|
||||||
tails[i] = num;
|
|
||||||
}
|
|
||||||
return tails.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 3.865s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
export const findLISLength = async (nums) => {
|
|
||||||
const { bisectLeft } = await import('https://cdn.jsdelivr.net/npm/d3-array@3/+esm');
|
|
||||||
const tails = [];
|
|
||||||
|
|
||||||
for (const x of nums) {
|
|
||||||
const i = bisectLeft(tails, x);
|
|
||||||
tails[i] = x;
|
|
||||||
}
|
|
||||||
|
|
||||||
return tails.length;
|
|
||||||
};
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 29.407s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
const findLISLength = async nums => {
|
|
||||||
const { bisectLeft } = await import('https://cdn.jsdelivr.net/npm/d3-array/+esm')
|
|
||||||
const tails = []
|
|
||||||
|
|
||||||
for (const n of nums) {
|
|
||||||
tails[bisectLeft(tails, n)] = n
|
|
||||||
}
|
|
||||||
|
|
||||||
return tails.length
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 25.399s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
async function findLISLength(nums) {
|
|
||||||
const { bisectLeft } = await import('https://cdn.skypack.dev/d3-array');
|
|
||||||
const tails = [];
|
|
||||||
|
|
||||||
for (const x of nums) {
|
|
||||||
const i = bisectLeft(tails, x);
|
|
||||||
i === tails.length ? tails.push(x) : (tails[i] = x);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tails.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 0.903s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
export const findLISLength = async a => {
|
|
||||||
const { bisectLeft } = await import("https://esm.sh/d3-array");
|
|
||||||
const s = [];
|
|
||||||
for (const x of a) s[bisectLeft(s, x)] = x;
|
|
||||||
return s.length;
|
|
||||||
};
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 15.537s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
async function findLISLength(arr) {
|
|
||||||
const { bisectLeft } = await import('https://cdn.jsdelivr.net/npm/d3-array@3/+esm');
|
|
||||||
const tails = [];
|
|
||||||
for (const v of arr) {
|
|
||||||
const i = bisectLeft(tails, v);
|
|
||||||
i === tails.length ? tails.push(v) : (tails[i] = v);
|
|
||||||
}
|
|
||||||
return tails.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 22.716s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
const findLISLength = async a => {
|
|
||||||
if (!a?.length) return 0
|
|
||||||
const { bisectLeft: b } = await import('https://cdn.jsdelivr.net/npm/d3-array@3/+esm')
|
|
||||||
const t = []
|
|
||||||
for (const x of a) {
|
|
||||||
const i = b(t, x)
|
|
||||||
i === t.length ? t.push(x) : t[i] = x
|
|
||||||
}
|
|
||||||
return t.length
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 34.651s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
async function findLISLength(arr) {
|
|
||||||
if (!Array.isArray(arr)) throw new TypeError("Expected an array of numbers");
|
|
||||||
const { bisectLeft } = await import("https://cdn.jsdelivr.net/npm/d3-array@3/+esm");
|
|
||||||
const tails = [];
|
|
||||||
for (const n of arr) {
|
|
||||||
if (typeof n !== "number" || Number.isNaN(n)) throw new TypeError("Array must contain only valid numbers");
|
|
||||||
tails[bisectLeft(tails, n)] = n;
|
|
||||||
}
|
|
||||||
return tails.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 7.363s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
async function findLISLength(arr) {
|
|
||||||
const { bisectLeft } = await import('https://cdn.jsdelivr.net/npm/d3-array@3');
|
|
||||||
let tails = [];
|
|
||||||
for (let num of arr) {
|
|
||||||
let pos = bisectLeft(tails, num);
|
|
||||||
if (pos === tails.length) {
|
|
||||||
tails.push(num);
|
|
||||||
} else {
|
|
||||||
tails[pos] = num;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return tails.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 47.415s
|
|
||||||
// Result: FAIL
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
async function findLISLength(n) {
|
|
||||||
const { bisectLeft } = await import('https://cdn.skypack.dev/d3-array');
|
|
||||||
const t = [];
|
|
||||||
for (const v of n) {
|
|
||||||
const i = bisectLeft(t, v);
|
|
||||||
i === t.length ? t.push(v) : t[i] = v;
|
|
||||||
}
|
|
||||||
return t.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 41.894s
|
|
||||||
// Result: PASS
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
async function findLISLength(nums) {
|
|
||||||
const { bisectLeft } = await import('https://esm.sh/d3-array@3');
|
|
||||||
const tails = [];
|
|
||||||
for (const n of nums) {
|
|
||||||
const i = bisectLeft(tails, n);
|
|
||||||
i < tails.length ? tails[i] = n : tails.push(n);
|
|
||||||
}
|
|
||||||
return tails.length;
|
|
||||||
}
|
|
||||||
export default findLISLength;
|
|
||||||
// Generation time: 96.878s
|
|
||||||
// Result: PASS
|
|
||||||
Reference in New Issue
Block a user