Watch inorder traversal visit left, root, then right on a binary tree. Worked example on a five node tree, a stack version, and a tree you can edit yourself.
About this algorithm
In-order traversal visits a binary tree's left subtree, then the node, then the right subtree. Its best-known use is on a binary search tree, where every value on the left is smaller and every value on the right is larger: there, in-order reads the values out in ascending sorted order.
Use in-order when the tree is a binary search tree and order matters: listing the values sorted, finding the k-th smallest, checking that a tree really follows the search tree rule, or flattening it into a sorted list. Pre-order is the better pick for copying or saving a tree, because it meets each parent before its children. Post-order fits when a node needs its children answered first. On a plain binary tree with no ordering rule, in-order has no special meaning; it is one fixed way to list the nodes.
From the current node, go to the left child and run the whole in-order process there first. Keep going left until there is no left child.
When the left side is finished, record the current node's value. In a binary search tree this is the smallest value not yet recorded.
Then run in-order on the right child. When it finishes, this node is done and control returns to its parent, which is now ready to record itself.
Without recursion: push nodes while moving left, then pop one, record it, and move to its right child. Repeat until the stack is empty and there is no current node. This form makes it easy to stop early, for example right after the k-th value.
The page loads root 0 with left child 1 and right child 2; 1 has a left child 3, and 2 has a right child 4. From 0 go left to 1, then left to 3. 3 has no left child, so record 3; it has no right child either. Back at 1, record 1; 1 has no right child. Back at 0, record 0, then go right to 2. 2 has no left child, so record 2, then go right to 4 and record it. The output is 3, 1, 0, 2, 4. That is not sorted, because this tree was numbered in the order its nodes were added and does not follow the search tree rule. A search tree holding 1 to 7, with 4 at the root, 2 and 6 below it and 1, 3, 5, 7 as leaves, would come out as 1, 2, 3, 4, 5, 6, 7.
A tree with distinct values is a valid binary search tree exactly when its in-order output is strictly increasing. Keep the last value you recorded and compare each new one against it; a single value that is not larger means the rule is broken. This catches cases a parent-and-child check misses, such as a small value deep inside a right subtree.
Time: every node is recorded exactly once and every child link is followed once, so the work is proportional to N. Space: the recursion or the explicit stack holds the nodes still waiting to be recorded on the current path, at most the height H.