mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Docs: Update benchmark results
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
const findLISLength = async (arr) => {
|
||||
async function findLISLength(arr) {
|
||||
const { bisectLeft } = await import('https://cdn.jsdelivr.net/npm/d3-array@3/+esm');
|
||||
|
||||
if (!arr?.length) return 0;
|
||||
|
||||
const { bisectLeft } = await import('https://cdn.skypack.dev/d3-array');
|
||||
const tails = [];
|
||||
|
||||
for (const num of arr) {
|
||||
@@ -10,5 +11,5 @@ const findLISLength = async (arr) => {
|
||||
}
|
||||
|
||||
return tails.length;
|
||||
};
|
||||
}
|
||||
export default findLISLength;
|
||||
@@ -1,16 +1,16 @@
|
||||
const findLISLength = async (nums) => {
|
||||
async function findLISLength(nums) {
|
||||
if (!nums?.length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const { bisectLeft } = await import('https://esm.sh/d3-array');
|
||||
|
||||
const tails = [];
|
||||
const { bisectLeft } = await import('https://cdn.jsdelivr.net/npm/d3-array@3/+esm');
|
||||
|
||||
const sub = [];
|
||||
|
||||
for (const num of nums) {
|
||||
tails[bisectLeft(tails, num)] = num;
|
||||
sub[bisectLeft(sub, num)] = num;
|
||||
}
|
||||
|
||||
return tails.length;
|
||||
};
|
||||
return sub.length;
|
||||
}
|
||||
export default findLISLength;
|
||||
7
tests/3_lis/outputs/google_gemini-3-pro-preview.js
Normal file
7
tests/3_lis/outputs/google_gemini-3-pro-preview.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const findLISLength = async arr => {
|
||||
const { bisectLeft } = await import('https://esm.sh/d3-array')
|
||||
const tails = []
|
||||
for (const n of arr) tails[bisectLeft(tails, n)] = n
|
||||
return tails.length
|
||||
}
|
||||
export default findLISLength;
|
||||
@@ -1,7 +1,12 @@
|
||||
async function findLISLength(nums){
|
||||
const{bisectLeft}=await import('https://cdn.skypack.dev/d3-array');
|
||||
const tails=[];
|
||||
for(const n of nums)tails[bisectLeft(tails,n)]=n;
|
||||
return tails.length;
|
||||
}
|
||||
export const findLISLength = async (arr) => {
|
||||
if (!Array.isArray(arr) || !arr.length) return 0;
|
||||
try {
|
||||
const { bisectLeft } = await import('https://cdn.skypack.dev/d3-array@3');
|
||||
const t = [];
|
||||
for (const v of arr) t[bisectLeft(t, v)] = v;
|
||||
return t.length;
|
||||
} catch {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
export default findLISLength;
|
||||
@@ -1,10 +0,0 @@
|
||||
async function findLISLength(a) {
|
||||
const {bisectLeft} = await import("https://cdn.jsdelivr.net/npm/d3-array@3/+esm");
|
||||
const t = [];
|
||||
for (const x of a) {
|
||||
const i = bisectLeft(t, x);
|
||||
t[i] = x;
|
||||
}
|
||||
return t.length;
|
||||
}
|
||||
export default findLISLength;
|
||||
@@ -1,7 +1,11 @@
|
||||
async function findLISLength(a){
|
||||
const {bisectLeft:b}=await import('https://cdn.jsdelivr.net/npm/d3-array@3/+esm')
|
||||
const t=[]
|
||||
for(const n of a)t[b(t,n)]=n
|
||||
return t.length
|
||||
const findLISLength = async nums => {
|
||||
if (!Array.isArray(nums)) throw new TypeError('Expected array')
|
||||
const { bisectLeft } = await import('https://cdn.jsdelivr.net/npm/d3-array@3/+esm')
|
||||
const tails = []
|
||||
for (const v of nums) {
|
||||
const i = bisectLeft(tails, v)
|
||||
i === tails.length ? tails.push(v) : tails[i] = v
|
||||
}
|
||||
return tails.length
|
||||
}
|
||||
export default findLISLength;
|
||||
@@ -1,12 +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 x of arr) {
|
||||
const i = bisectLeft(tails, x);
|
||||
if(i === tails.length) tails.push(x);
|
||||
else tails[i] = x;
|
||||
}
|
||||
return tails.length;
|
||||
}
|
||||
export default findLISLength;
|
||||
@@ -1,14 +1,2 @@
|
||||
async function findLISLength(arr) {
|
||||
const {bisectLeft} = await import('https://cdn.skypack.dev/d3-array');
|
||||
let tails = [];
|
||||
for (let num of arr) {
|
||||
let i = bisectLeft(tails, num);
|
||||
if (i === tails.length) {
|
||||
tails.push(num);
|
||||
} else {
|
||||
tails[i] = num;
|
||||
}
|
||||
}
|
||||
return tails.length;
|
||||
}
|
||||
async function findLISLength(arr){const{bisectLeft}=await import('https://cdn.skypack.dev/d3-array');let tails=[];for(const num of arr){const i=bisectLeft(tails,num);i===tails.length?tails.push(num):tails[i]=num;}return tails.length;}
|
||||
export default findLISLength;
|
||||
Reference in New Issue
Block a user