This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import ( | |
Callable, | |
Iterator, | |
Generator, | |
Protocol, | |
Tuple, | |
TypeVar, | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const problemSize = 10000; | |
const g = n => n ** 2; // theoretical guess function | |
const timeRatios = []; | |
const m = 5; // from the O(g(n)) definition | |
const alpha = 1/127.372 // some suitable conversion constant | |
// depending on the CPUs number of | |
// instructions per second | |
let start = 0; | |
for (const n = m; i <= problemSize; n++) { |