vebt
Version:
A Van Emde Boas tree, also known as a vEB tree, is a tree data structure which implements an associative array with k-bit integer keys. It performs all operations in O(log k) time, or equivalently in O(log log K) time, where K = 2^k is the maximum number
24 lines (19 loc) • 466 B
JavaScript
//// Random generators
function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
//// Fibonacci sequence generator
function fibonacci(n){
var i
var fib = [0,1]
let c = 2; while(c < n){
fib[c] = fib[c-2] + fib[c-1]
c++
}
return fib
}
//// Exports
module.exports = {getRandomArbitrary, getRandomInt, fibonacci}