In-order traversal (applies to binary trees) is where a node is visited after its left sub-tree and before the right sub-tree.
def inOrder(T, v):
if hasLeft(v):
inOrder(T, left(v))
visit(v)
if hasRight(v):
inOrder(T, right(v))In-order traversal (applies to binary trees) is where a node is visited after its left sub-tree and before the right sub-tree.
def inOrder(T, v):
if hasLeft(v):
inOrder(T, left(v))
visit(v)
if hasRight(v):
inOrder(T, right(v))