btree.js icon indicating copy to clipboard operation
btree.js copied to clipboard

Wrong key deleted

Open trincot opened this issue 7 years ago • 0 comments

Sometimes the wrong key is deleted. Example:

const Tree = btree.create(5, btree.numcmp);
const tree = new Tree();

for (const key of [7,6,1,5,4,8,2,3]) tree.put(key, key+"");
for (const key of [7,4,2,5]) tree.del(key);
console.log(tree.get(5)); // "5", but should be undefined
console.log(tree.get(3)); // undefined, but should be "3"

trincot avatar May 31 '19 13:05 trincot