Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buggy. Inserted 5 words but only 3 words were inserted. #39

Open
spam0115 opened this issue Jul 10, 2024 · 1 comment
Open

Buggy. Inserted 5 words but only 3 words were inserted. #39

spam0115 opened this issue Jul 10, 2024 · 1 comment

Comments

@spam0115
Copy link

I inserted "cats","dog","sand","and","cat" but only cats, dogs, and sand were inserted.

@episage
Copy link

episage commented Jul 21, 2024

import { RBTree } from 'bintrees'

let tree = new RBTree((a, b) => a.localeCompare(b));
["cats", "dog", "sand", "and", "cat"].forEach(animal => {
  tree.insert(animal);
});

tree.each(v => {
  console.log(v);
})
node index.js 
and
cat
cats
dog
sand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants