/* eslint-disable no-magic-numbers */ import { BinarySearchTree } from './binarySearchTree.js'; describe('insertion', () => { test('ignores the repeats in insertion sequence #0', () => { expect(new BinarySearchTree([0, 1, 2, 3, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #1', () => { expect(new BinarySearchTree([0, 1, 2, 3, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #2', () => { expect(new BinarySearchTree([0, 1, 2, 3, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #3', () => { expect(new BinarySearchTree([0, 1, 2, 3, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #4', () => { expect(new BinarySearchTree([0, 1, 3, 2, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #5', () => { expect(new BinarySearchTree([0, 1, 3, 2, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #6', () => { expect(new BinarySearchTree([0, 1, 3, 2, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #7', () => { expect(new BinarySearchTree([0, 1, 3, 2, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #8', () => { expect(new BinarySearchTree([0, 2, 1, 3, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #9', () => { expect(new BinarySearchTree([0, 2, 1, 3, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #10', () => { expect(new BinarySearchTree([0, 2, 1, 3, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #11', () => { expect(new BinarySearchTree([0, 2, 1, 3, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #12', () => { expect(new BinarySearchTree([0, 2, 3, 1, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #13', () => { expect(new BinarySearchTree([0, 2, 3, 1, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #14', () => { expect(new BinarySearchTree([0, 2, 3, 1, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #15', () => { expect(new BinarySearchTree([0, 2, 3, 1, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #16', () => { expect(new BinarySearchTree([0, 3, 1, 2, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #17', () => { expect(new BinarySearchTree([0, 3, 1, 2, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #18', () => { expect(new BinarySearchTree([0, 3, 1, 2, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #19', () => { expect(new BinarySearchTree([0, 3, 1, 2, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #20', () => { expect(new BinarySearchTree([0, 3, 2, 1, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #21', () => { expect(new BinarySearchTree([0, 3, 2, 1, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #22', () => { expect(new BinarySearchTree([0, 3, 2, 1, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #23', () => { expect(new BinarySearchTree([0, 3, 2, 1, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #24', () => { expect(new BinarySearchTree([1, 0, 2, 3, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #25', () => { expect(new BinarySearchTree([1, 0, 2, 3, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #26', () => { expect(new BinarySearchTree([1, 0, 2, 3, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #27', () => { expect(new BinarySearchTree([1, 0, 2, 3, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #28', () => { expect(new BinarySearchTree([1, 0, 3, 2, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #29', () => { expect(new BinarySearchTree([1, 0, 3, 2, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #30', () => { expect(new BinarySearchTree([1, 0, 3, 2, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #31', () => { expect(new BinarySearchTree([1, 0, 3, 2, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #32', () => { expect(new BinarySearchTree([1, 2, 0, 3, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #33', () => { expect(new BinarySearchTree([1, 2, 0, 3, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #34', () => { expect(new BinarySearchTree([1, 2, 0, 3, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #35', () => { expect(new BinarySearchTree([1, 2, 0, 3, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #36', () => { expect(new BinarySearchTree([1, 2, 3, 0, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #37', () => { expect(new BinarySearchTree([1, 2, 3, 0, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #38', () => { expect(new BinarySearchTree([1, 2, 3, 0, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #39', () => { expect(new BinarySearchTree([1, 2, 3, 0, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #40', () => { expect(new BinarySearchTree([1, 3, 0, 2, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #41', () => { expect(new BinarySearchTree([1, 3, 0, 2, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #42', () => { expect(new BinarySearchTree([1, 3, 0, 2, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #43', () => { expect(new BinarySearchTree([1, 3, 0, 2, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #44', () => { expect(new BinarySearchTree([1, 3, 2, 0, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #45', () => { expect(new BinarySearchTree([1, 3, 2, 0, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #46', () => { expect(new BinarySearchTree([1, 3, 2, 0, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #47', () => { expect(new BinarySearchTree([1, 3, 2, 0, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #48', () => { expect(new BinarySearchTree([2, 0, 1, 3, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #49', () => { expect(new BinarySearchTree([2, 0, 1, 3, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #50', () => { expect(new BinarySearchTree([2, 0, 1, 3, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #51', () => { expect(new BinarySearchTree([2, 0, 1, 3, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #52', () => { expect(new BinarySearchTree([2, 0, 3, 1, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #53', () => { expect(new BinarySearchTree([2, 0, 3, 1, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #54', () => { expect(new BinarySearchTree([2, 0, 3, 1, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #55', () => { expect(new BinarySearchTree([2, 0, 3, 1, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #56', () => { expect(new BinarySearchTree([2, 1, 0, 3, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #57', () => { expect(new BinarySearchTree([2, 1, 0, 3, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #58', () => { expect(new BinarySearchTree([2, 1, 0, 3, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #59', () => { expect(new BinarySearchTree([2, 1, 0, 3, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #60', () => { expect(new BinarySearchTree([2, 1, 3, 0, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #61', () => { expect(new BinarySearchTree([2, 1, 3, 0, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #62', () => { expect(new BinarySearchTree([2, 1, 3, 0, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #63', () => { expect(new BinarySearchTree([2, 1, 3, 0, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #64', () => { expect(new BinarySearchTree([2, 3, 0, 1, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #65', () => { expect(new BinarySearchTree([2, 3, 0, 1, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #66', () => { expect(new BinarySearchTree([2, 3, 0, 1, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #67', () => { expect(new BinarySearchTree([2, 3, 0, 1, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #68', () => { expect(new BinarySearchTree([2, 3, 1, 0, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #69', () => { expect(new BinarySearchTree([2, 3, 1, 0, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #70', () => { expect(new BinarySearchTree([2, 3, 1, 0, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #71', () => { expect(new BinarySearchTree([2, 3, 1, 0, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #72', () => { expect(new BinarySearchTree([3, 0, 1, 2, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #73', () => { expect(new BinarySearchTree([3, 0, 1, 2, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #74', () => { expect(new BinarySearchTree([3, 0, 1, 2, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #75', () => { expect(new BinarySearchTree([3, 0, 1, 2, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #76', () => { expect(new BinarySearchTree([3, 0, 2, 1, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #77', () => { expect(new BinarySearchTree([3, 0, 2, 1, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #78', () => { expect(new BinarySearchTree([3, 0, 2, 1, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #79', () => { expect(new BinarySearchTree([3, 0, 2, 1, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #80', () => { expect(new BinarySearchTree([3, 1, 0, 2, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #81', () => { expect(new BinarySearchTree([3, 1, 0, 2, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #82', () => { expect(new BinarySearchTree([3, 1, 0, 2, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #83', () => { expect(new BinarySearchTree([3, 1, 0, 2, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #84', () => { expect(new BinarySearchTree([3, 1, 2, 0, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #85', () => { expect(new BinarySearchTree([3, 1, 2, 0, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #86', () => { expect(new BinarySearchTree([3, 1, 2, 0, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #87', () => { expect(new BinarySearchTree([3, 1, 2, 0, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #88', () => { expect(new BinarySearchTree([3, 2, 0, 1, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #89', () => { expect(new BinarySearchTree([3, 2, 0, 1, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #90', () => { expect(new BinarySearchTree([3, 2, 0, 1, 0]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #91', () => { expect(new BinarySearchTree([3, 2, 0, 1, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #92', () => { expect(new BinarySearchTree([3, 2, 1, 0, 3]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #93', () => { expect(new BinarySearchTree([3, 2, 1, 0, 2]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #94', () => { expect(new BinarySearchTree([3, 2, 1, 0, 1]).toList()).toEqual([0, 1, 2, 3]); }); test('ignores the repeats in insertion sequence #95', () => { expect(new BinarySearchTree([3, 2, 1, 0, 0]).toList()).toEqual([0, 1, 2, 3]); }); });