bigary
v1.0.12
Published
bigary ======================= - slow but big array , only work in nodejs.
Readme
bigary
- slow but big array , only work in nodejs.
install
- npm install bigary
usage
const x = require("bigary");example
> a=require("bigary")()
Proxy [
A [0] { ptr: 499760608 },
{
get: [Function: get],
set: [Function: set],
deleteProperty: [Function: deleteProperty],
getOwnPropertyDescriptor: [Function: getOwnPropertyDescriptor],
ownKeys: [Function: ownKeys],
has: [Function: has],
getPrototypeOf: [Function: getPrototypeOf]
}
]
> var f= ()=>{ for(let i=0;i<10000000;++i) {a[i]=`sml_str${i}`} }
undefined
> f()
undefined
> a
Proxy [
A [10000000] { ptr: 499760608 },
{
get: [Function: get],
set: [Function: set],
deleteProperty: [Function: deleteProperty],
getOwnPropertyDescriptor: [Function: getOwnPropertyDescriptor],
ownKeys: [Function: ownKeys],
has: [Function: has],
getPrototypeOf: [Function: getPrototypeOf]
}
]
> a[9999999]
'sml_str9999999'
>
a.clear();
a.push(3, 2, 4, 1, 5, 9);
a.to_max_heap((a,b)=>a<b);
a.is_heap(); //true
for(let i=0;i<r.length;++i){console.log(a[i])}
//9 5 4 1 2 3
a.heap_push(100,99,300,97,98);
for(let i=0;i<r.length;++i){console.log(a[i])}
//
a.heap_sort();
for(let i=0;i<r.length;++i){console.log(a[i])}
a.is_heap(); //false sort will change heap to non-heap
a.destroy(); //MUST
METHODS
a.clear a.destroy a.insert
a.pop a.push a.rm
a.to_heap
a.to_max_heap
a.to_min_heap
a.heap_push
a.heap_pop
a.is_heapGETTERS
a.fst a.lst a.length
a.heap_cmp_funcAPIS
LICENSE
- ISC
