MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / test_min_max

Function test_min_max

data_structures/binary_tree/red_black_tree.py:645–654  ·  view source on GitHub ↗

Tests the min and max functions in the tree.

()

Source from the content-addressed store, hash-verified

643
644
645def test_min_max() -> bool:
646 """Tests the min and max functions in the tree."""
647 tree = RedBlackTree(0)
648 tree.insert(-16)
649 tree.insert(16)
650 tree.insert(8)
651 tree.insert(24)
652 tree.insert(20)
653 tree.insert(22)
654 return not (tree.get_max() != 22 or tree.get_min() != -16)
655
656
657def test_tree_traversal() -> bool:

Callers

nothing calls this directly

Calls 4

insertMethod · 0.95
get_maxMethod · 0.95
get_minMethod · 0.95
RedBlackTreeClass · 0.85

Tested by

no test coverage detected