Two nodes in one cell
transcript
A page builder lists blocks by column, from the top row down. The rule says that the smaller id comes first when blocks tie. Our code returns six before five.
A left child goes one column left. A right child goes one column right. Both go one row down.
Node three has the code six. It is the right child of node one, so it goes right. Node four has the code five. It is the left child of node two, so it goes left. Both land in column zero, row two.
A sort by column and row keeps the queue order. The queue reached six first. So six comes first. Add the code to the sort key. Now five comes first.
Without the code: one, six, five. With the code: one, five, six. The second is the answer.
Give each node a column and a row. Break ties with the code. Full breakdown in the lecture.