public void Reset()
{
pre = true;
stack.Clear();
// use depth-first traversal to push nodes into stack
// the lowest node will be at the top of the stack
if(ascending) {
// find the lowest node
while(tnode != sentinelNode) {
stack.Push(tnode);
tnode = tnode.Left;
}
}
else {
// the highest node will be at top of stack
while(tnode != sentinelNode) {
stack.Push(tnode);
tnode = tnode.Right;
}
}
}