@@ -565,25 +565,25 @@ def test_RedBlackTree():
565
565
assert [node .key for node in in_order ] == [2 , 6 , 7 , 10 , 15 , 16 , 17 , 18 , 25 , 30 , 40 , 60 ]
566
566
assert [node .key for node in pre_order ] == [16 , 10 , 6 , 2 , 7 , 15 , 25 , 18 , 17 , 40 , 30 , 60 ]
567
567
568
- # assert tree.lower_bound(0) == 2
569
- # assert tree.lower_bound(2) == 2
570
- # assert tree.lower_bound(3) == 6
571
- # assert tree.lower_bound(7) == 7
572
- # assert tree.lower_bound(25) == 25
573
- # assert tree.lower_bound(32) == 40
574
- # assert tree.lower_bound(41) == 60
575
- # assert tree.lower_bound(60) == 60
576
- # assert tree.lower_bound(61) is None
577
-
578
- # assert tree.upper_bound(0) == 2
579
- # assert tree.upper_bound(2) == 6
580
- # assert tree.upper_bound(3) == 6
581
- # assert tree.upper_bound(7) == 10
582
- # assert tree.upper_bound(25) == 30
583
- # assert tree.upper_bound(32) == 40
584
- # assert tree.upper_bound(41) == 60
585
- # assert tree.upper_bound(60) is None
586
- # assert tree.upper_bound(61) is None
568
+ assert tree .lower_bound (0 ) == 2
569
+ assert tree .lower_bound (2 ) == 2
570
+ assert tree .lower_bound (3 ) == 6
571
+ assert tree .lower_bound (7 ) == 7
572
+ assert tree .lower_bound (25 ) == 25
573
+ assert tree .lower_bound (32 ) == 40
574
+ assert tree .lower_bound (41 ) == 60
575
+ assert tree .lower_bound (60 ) == 60
576
+ assert tree .lower_bound (61 ) is None
577
+
578
+ assert tree .upper_bound (0 ) == 2
579
+ assert tree .upper_bound (2 ) == 6
580
+ assert tree .upper_bound (3 ) == 6
581
+ assert tree .upper_bound (7 ) == 10
582
+ assert tree .upper_bound (25 ) == 30
583
+ assert tree .upper_bound (32 ) == 40
584
+ assert tree .upper_bound (41 ) == 60
585
+ assert tree .upper_bound (60 ) is None
586
+ assert tree .upper_bound (61 ) is None
587
587
588
588
# tree = RedBlackTree()
589
589
0 commit comments