Introduction - If you have any usage issues, please Google them yourself
Common implementation approach is to use two array, t [n-1] and e [n], the array storage of all e sort of take part in the elements, are in complete binary tree in leaf nodes, t [] are stored stage game winner serial number and then sort the end of n times a game, time complexity is O (n* log2 (n)), in fact I think it is only through an array A [2* n-1] can also be implementation, but labeling it a bit complicated conversion.