Micro Encoder interview question

Given a binary tree produce an algorithm to connect nodes at the same level. Tree might be unbalanced.