MCPcopy Create free account
hub / github.com/Techtonica/curriculum / wrapArray

Function wrapArray

runtime-complexity/runtime.js:52–67  ·  view source on GitHub ↗
(f, sorted)

Source from the content-addressed store, hash-verified

50};
51
52const wrapArray = (f, sorted) => {
53 const ret = (n, startTime, endTime) => {
54 const a = new Array(n);
55 for (let i = 0; i < n; i++) {
56 a[i] = Math.random(); //Math.floor(Math.random() * n * n);
57 }
58 if (sorted) {
59 a.sort();
60 }
61 startTime();
62 const res = f(a);
63 endTime();
64 return res;
65 };
66 return ret;
67};
68
69const wrapString = (f) => {
70 const ret = (n, startTime, endTime) => {

Callers 1

runtime.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected