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.
-
-