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

Function test_insertion_speed

data_structures/binary_tree/red_black_tree.py:560–567  ·  view source on GitHub ↗

Test that the tree balances inserts to O(log(n)) by doing a lot of them.

()

Source from the content-addressed store, hash-verified

558
559
560def test_insertion_speed() -> bool:
561 """Test that the tree balances inserts to O(log(n)) by doing a lot
562 of them.
563 """
564 tree = RedBlackTree(-1)
565 for i in range(300000):
566 tree = tree.insert(i)
567 return True
568
569
570def test_insert() -> bool:

Callers 1

mainFunction · 0.85

Calls 2

insertMethod · 0.95
RedBlackTreeClass · 0.85

Tested by

no test coverage detected