def test_inorder(self):
        expected = '4 2 5 1 6 3 7'

        result = traversal.inorder(self.root)

        self.assertEquals(result, expected)
Esempio n. 2
0
    def test_inorder(self):
        expected = '4 2 5 1 6 3 7'

        result = traversal.inorder(self.root)

        self.assertEquals(result, expected)
Esempio n. 3
0
    def test_remove_root(self):
        self.root.remove(50)

        expected = '3 10 15 24 30 42 60 73 80 83 87 100'
        self.assertEquals(traversal.inorder(self.root), expected)
Esempio n. 4
0
    def test_remove_two_children(self):
        self.root.remove(30)

        expected = '3 10 15 24 42 50 60 73 80 83 87 100'
        self.assertEquals(traversal.inorder(self.root), expected)
Esempio n. 5
0
    def test_remove_single_child(self):
        self.root.remove(10)

        expected = '3 15 24 30 42 50 60 73 80 83 87 100'
        self.assertEquals(traversal.inorder(self.root), expected)
Esempio n. 6
0
    def test_remove_leaf(self):
        self.root.remove(3)

        expected = '10 15 24 30 42 50 60 73 80 83 87 100'
        self.assertEquals(traversal.inorder(self.root), expected)
Esempio n. 7
0
 def test_insert(self):
     expected = '3 10 15 24 30 42 50 60 73 80 83 87 100'
     self.assertEquals(traversal.inorder(self.root), expected)