functional-red-black-tree
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "functional-red-black-tree", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A fully persistent balanced binary search tree", | ||
@@ -5,0 +5,0 @@ "main": "rbtree.js", |
@@ -479,6 +479,4 @@ "use strict" | ||
var n = this.root | ||
var stack = [] | ||
while(n) { | ||
var d = cmp(key, n.key) | ||
stack.push(n) | ||
if(d === 0) { | ||
@@ -485,0 +483,0 @@ return n.value |
@@ -298,2 +298,10 @@ "use strict" | ||
for(var i=0; i<arr.length; ++i) { | ||
if(arr[i] !== arr[i-1] && arr[i] !== arr[i+1]) { | ||
t.equals(u.get(arr[i]), i, "get " + arr[i]) | ||
} | ||
} | ||
t.equals(u.get(-1), undefined, "get missing") | ||
t.equals(u.ge(3).index, 6, "ge simple") | ||
@@ -351,2 +359,3 @@ t.equals(u.ge(0.9).index, 1, "ge run start") | ||
t.end() | ||
@@ -401,1 +410,73 @@ }) | ||
}) | ||
tape("slab-sequence-2", function(t) { | ||
var u = makeTree() | ||
u=u.insert( 12 , 22 ) | ||
u=u.insert( 11 , 3 ) | ||
u=u.insert( 10 , 28 ) | ||
u=u.insert( 13 , 16 ) | ||
u=u.insert( 9 , 9 ) | ||
u=u.insert( 14 , 10 ) | ||
u=u.insert( 8 , 15 ) | ||
u=u.insert( 15 , 29 ) | ||
u=u.insert( 16 , 4 ) | ||
u=u.insert( 7 , 21 ) | ||
u=u.insert( 17 , 23 ) | ||
u=u.insert( 6 , 2 ) | ||
u=u.insert( 5 , 27 ) | ||
u=u.insert( 18 , 17 ) | ||
u=u.insert( 4 , 8 ) | ||
u=u.insert( 31 , 11 ) | ||
u=u.insert( 30 , 30 ) | ||
u=u.insert( 29 , 5 ) | ||
u=u.insert( 28 , 24 ) | ||
u=u.insert( 27 , 18 ) | ||
u=u.insert( 26 , 12 ) | ||
u=u.insert( 25 , 31 ) | ||
u=u.insert( 24 , 6 ) | ||
u=u.insert( 23 , 25 ) | ||
u=u.insert( 19 , 7 ) | ||
u=u.insert( 20 , 13 ) | ||
u=u.insert( 1 , 20 ) | ||
u=u.insert( 0 , 14 ) | ||
u=u.insert( 22 , 0 ) | ||
u=u.insert( 2 , 1 ) | ||
u=u.insert( 3 , 26 ) | ||
u=u.insert( 21 , 19 ) | ||
u=u.remove( 18 , 17 ) | ||
u=u.remove( 17 , 23 ) | ||
u=u.remove( 16 , 4 ) | ||
u=u.remove( 15 , 29 ) | ||
u=u.remove( 14 , 10 ) | ||
u=u.remove( 13 , 16 ) | ||
u=u.remove( 12 , 22 ) | ||
u=u.remove( 6 , 2 ) | ||
u=u.remove( 7 , 21 ) | ||
u=u.remove( 8 , 15 ) | ||
u=u.remove( 11 , 3 ) | ||
u=u.remove( 4 , 8 ) | ||
u=u.remove( 9 , 9 ) | ||
u=u.remove( 10 , 28 ) | ||
u=u.remove( 5 , 27 ) | ||
u=u.remove( 31 , 11 ) | ||
u=u.remove( 0 , 14 ) | ||
u=u.remove( 30 , 30 ) | ||
u=u.remove( 29 , 5 ) | ||
u=u.remove( 1 , 20 ) | ||
u=u.remove( 28 , 24 ) | ||
u=u.remove( 2 , 1 ) | ||
u=u.remove( 3 , 26 ) | ||
u=u.remove( 27 , 18 ) | ||
u=u.remove( 19 , 7 ) | ||
u=u.remove( 26 , 12 ) | ||
u=u.remove( 20 , 13 ) | ||
u=u.remove( 25 , 31 ) | ||
u=u.remove( 24 , 6 ) | ||
u=u.remove( 21 , 19 ) | ||
u=u.remove( 23 , 25 ) | ||
u=u.remove( 22 , 0 ) | ||
t.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43457
1359