|
|
@ -63,7 +63,6 @@ public class BST { |
|
|
// This non-recursive method returns a string that represents the in-order traversal |
|
|
// This non-recursive method returns a string that represents the in-order traversal |
|
|
// of the binary search tree. |
|
|
// of the binary search tree. |
|
|
public String inOrder() { |
|
|
public String inOrder() { |
|
|
// TODO: implement this method using a non-recursive solution |
|
|
|
|
|
String return_string = ""; |
|
|
String return_string = ""; |
|
|
Stack<BSTNode> stack = new Stack<BSTNode>(); |
|
|
Stack<BSTNode> stack = new Stack<BSTNode>(); |
|
|
BSTNode current = m_root; |
|
|
BSTNode current = m_root; |
|
|
@ -92,7 +91,6 @@ public class BST { |
|
|
// This method takes a reference to the root of the expression, evaluates |
|
|
// This method takes a reference to the root of the expression, evaluates |
|
|
// the tree, and returns the result as an int. |
|
|
// the tree, and returns the result as an int. |
|
|
public int evaluate(BSTNode node) { |
|
|
public int evaluate(BSTNode node) { |
|
|
// TODO: implement this method using a non-recursive solution |
|
|
|
|
|
return -1; // replace this statement with your own return |
|
|
return -1; // replace this statement with your own return |
|
|
} |
|
|
} |
|
|
} |
|
|
} |