mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-07-07 01:44:52 +08:00
Fix naming in binary search tree test.
This commit is contained in:
@ -48,7 +48,7 @@ describe('BinarySearchTree', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should insert object values', () => {
|
it('should insert object values', () => {
|
||||||
const nodeValueComparatorCallback = (a, b) => {
|
const nodeValueCompareFunction = (a, b) => {
|
||||||
const normalizedA = a || { value: null };
|
const normalizedA = a || { value: null };
|
||||||
const normalizedB = b || { value: null };
|
const normalizedB = b || { value: null };
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ describe('BinarySearchTree', () => {
|
|||||||
const obj2 = { key: 'obj2', value: 2, toString: () => 'obj2' };
|
const obj2 = { key: 'obj2', value: 2, toString: () => 'obj2' };
|
||||||
const obj3 = { key: 'obj3', value: 3, toString: () => 'obj3' };
|
const obj3 = { key: 'obj3', value: 3, toString: () => 'obj3' };
|
||||||
|
|
||||||
const bst = new BinarySearchTree(nodeValueComparatorCallback);
|
const bst = new BinarySearchTree(nodeValueCompareFunction);
|
||||||
|
|
||||||
bst.insert(obj2);
|
bst.insert(obj2);
|
||||||
bst.insert(obj3);
|
bst.insert(obj3);
|
||||||
|
Reference in New Issue
Block a user