Package algs32
Class MyIntSET
java.lang.Object
algs32.MyIntSET
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
private static boolean
static boolean
static MyIntSET
fromString
(String ints) int
height()
boolean
boolean
boolean
boolean
static void
void
void
put
(int key) private static MyIntSET.Node
put
(MyIntSET.Node n, int key) void
removeBelowDepth
(int k) void
void
void
private static void
int
size()
int
sizeAboveDepth
(int k) int
sizeAtDepth
(int k) int
sizeBelowDepth
(int k) int
sizeOdd()
private static void
private static void
testAddZeroToSingles
(String expected, String tree) private static void
testHeight
(int expected, String tree) private static void
testIsOddBalanced
(boolean expected, String tree) private static void
testIsPerfectlyBalancedH
(boolean expected, String tree) private static void
testIsPerfectlyBalancedS
(boolean expected, String tree) private static void
testIsSemiBalanced
(boolean expected, String tree) private static void
private static void
testOne()
private static void
testRemoveBelowDepth
(String expected, int depth, String tree) private static void
testRemoveLeaves
(String expected, String tree) private static void
testRemoveOddSubtrees
(String expected, String tree) private static void
testRemoveSingles
(String expected, String tree) private static void
private static void
testSizeAboveDepth
(int expected, int depth, String tree) private static void
testSizeAtDepth
(int expected, int depth, String tree) private static void
testSizeBelowDepth
(int expected, int depth, String tree) private static void
testSizeOdd
(int expected, String tree) void
toGraphviz
(String filename) private static void
toGraphviz
(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
-