高级检索

    荷兰国旗问题的一种有效算法

    An Efficient Algorithm of Dutch National Flag Problem

    • 摘要: 荷兰国旗问题是一个著名的算法问题.本文给出关于该问题的一种使用四个指针变量的有效算法.算法中对指针的初始位置进行了优化选择,在算法进程中采取了平衡推进的策略.试算结果表明,平均置换次数已接近问题的下界.文末对算法进行了概率分析.

       

      Abstract: Dutch National Flag Problem is a famous algorithm problem. An efficient algorithm using four pointer variables for the problem is presented in this paper. In this algo ithm the optimum choice of the initial position of pointer is made and a balanced advance strategy is employed. The result of calculation indicates that the average swap times of the algorithm are near the lower bound of the problem. Finally, the probabilistic analysis of the algorithm is given.

       

    /

    返回文章
    返回