public int findMin(Node node) {
if (node == null) {
return 100;
}
while (node.leftChild != null) {
node = node.leftChild;
}
return node.data;
}
public int findMax(Node node) {
if (node == null) {
return -100;
}
while (node.rightChild != null) {
node = node.rightChild;
}
return node.data;
}
if (node == null) {
return 100;
}
while (node.leftChild != null) {
node = node.leftChild;
}
return node.data;
}
public int findMax(Node node) {
if (node == null) {
return -100;
}
while (node.rightChild != null) {
node = node.rightChild;
}
return node.data;
}
No comments:
Post a Comment