📜  归并排序中哨兵的用途是什么 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:18.756000             🧑  作者: Mango

代码示例1
The use of sentinels in merge sort prevents us from needing to check to see if we have reached the end of either of the arrays being sorted. Merge sort can be performed without a sentinel, but an implementation of merge sort without a sentinel adds an additional check for every iteration of the comparison loop.