Skip to content

LCA implementation (fixes #89) #91

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

Merged
merged 12 commits into from
Oct 15, 2019
Merged
Prev Previous commit
Next Next commit
Update reference
  • Loading branch information
amahdy authored Oct 15, 2019
commit b2565c4289e7779d7328248012e0ab28d4e02ec3
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ describe('LCA', () => {
bst.add(10);

it('Should return 12', () => {
expect(lca(bst.root, 10, 14).data).toEqual(12);
expect(lca(bst.root, 10, 14).value).toEqual(12);
});

it('Should return 8', () => {
expect(lca(bst.root, 14, 8).data).toEqual(8);
expect(lca(bst.root, 14, 8).value).toEqual(8);
});

it('Should return 20', () => {
expect(lca(bst.root, 10, 22).data).toEqual(20);
expect(lca(bst.root, 10, 22).value).toEqual(20);
});
});