Example #1
0
    def test_1_node_tree_height(self):
        """
        Test a single node tree (no children) height

        :return:
        """
        assert 0 == tree_height(self.tree1)
Example #2
0
    def test_tree_height(self):
        """
        Test a random tree's height

        :return:
        """
        assert 2 == tree_height(self.tree0)
Example #3
0
    def test_1_node_tree_height(self):
        """
        Test a single node tree (no children) height

        :return:
        """
        assert 0 == tree_height(self.tree1)
Example #4
0
    def test_tree_height(self):
        """
        Test a random tree's height

        :return:
        """
        assert 2 == tree_height(self.tree0)
Example #5
0
    def test_one_sided_tree(self):
        """
        Test a one-sided tree
        (basically a linked list)

        :return:
        """
        assert 5 == tree_height(self.tree2)
Example #6
0
    def test_one_sided_tree(self):
        """
        Test a one-sided tree
        (basically a linked list)

        :return:
        """
        assert 5 == tree_height(self.tree2)