Package algs32
Class MyIntSET
java.lang.Object
algs32.MyIntSET
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate static booleanstatic booleanstatic MyIntSETfromString(String ints) intheight()booleanbooleanbooleanbooleanstatic voidvoidvoidput(int key) private static MyIntSET.Nodeput(MyIntSET.Node n, int key) voidremoveBelowDepth(int k) voidvoidvoidprivate static voidintsize()intsizeAboveDepth(int k) intsizeAtDepth(int k) intsizeBelowDepth(int k) intsizeOdd()private static voidprivate static voidtestAddZeroToSingles(String expected, String tree) private static voidtestHeight(int expected, String tree) private static voidtestIsOddBalanced(boolean expected, String tree) private static voidtestIsPerfectlyBalancedH(boolean expected, String tree) private static voidtestIsPerfectlyBalancedS(boolean expected, String tree) private static voidtestIsSemiBalanced(boolean expected, String tree) private static voidprivate static voidtestOne()private static voidtestRemoveBelowDepth(String expected, int depth, String tree) private static voidtestRemoveLeaves(String expected, String tree) private static voidtestRemoveOddSubtrees(String expected, String tree) private static voidtestRemoveSingles(String expected, String tree) private static voidprivate static voidtestSizeAboveDepth(int expected, int depth, String tree) private static voidtestSizeAtDepth(int expected, int depth, String tree) private static voidtestSizeBelowDepth(int expected, int depth, String tree) private static voidtestSizeOdd(int expected, String tree) voidtoGraphviz(String filename) private static voidtoGraphviz(GraphvizBuilder gb, MyIntSET.Node parent, MyIntSET.Node n) toString()
-
Field Details
-
root
-
exampleCount
-
-
Constructor Details
-
MyIntSET
public MyIntSET()
-
-
Method Details
-
printLeftI
-
size
-
height
-
sizeOdd
-
sizeAtDepth
-
sizeAboveDepth
-
sizeBelowDepth
-
isPerfectlyBalancedS
-
isPerfectlyBalancedH
-
isOddBalanced
-
isSemiBalanced
-
removeOddSubtrees
-
removeBelowDepth
-
addZeroToSingles
-
removeLeaves
-
removeSingles
-
main
-
testOne
-
testAccessors
-
testMutators
-
show
-
testSize
-
testHeight
-
testSizeOdd
-
testSizeAtDepth
-
testSizeAboveDepth
-
testSizeBelowDepth
-
testIsPerfectlyBalancedS
-
testIsPerfectlyBalancedH
-
testIsOddBalanced
-
testIsSemiBalanced
-
testRemoveOddSubtrees
-
testRemoveBelowDepth
-
testRemoveSingles
-
testRemoveLeaves
-
testAddZeroToSingles
-
put
-
put
-
areEquals
-
areEquals
-
fromString
-
levelOrder
-
toString
-
toGraphviz
-
toGraphviz
-