在处理一个节点时,该模板递归地调用自身,以便处理该节点的孩子。
When processing a node, the template recursively calls itself to process the children of the node.
注意,此版本甚至可以在循环自身中使用递归,两次调用循环本身,一次用于对列表左手边的内容进行排序,另一次对列表右手边的内容进行排序。
Notice that this version even makes use of recursiveness in itself, calling itself twice, once to sort the left-hand side of the list, and once again to sort the right-hand side of the list.
当前计算的结果依赖于之前的部分结果,所以,在每次后续递归调用中,我们向前传递那些结果。
The result of the present computation depended on the partial results before it, so in each successive recursive call, we pass those results forward.
应用推荐