Pseudo-Knighted Cocktail Shaker Sort
摘要
Data sorting is a primary problem of computational sciences. There exist different sorting techniques among them bubble sort is a primitive one and it is widely used in many applications due to its simple architecture and development procedure. However, the main concern of this algorithm is time consumption. So, different researchers aimed to reduce its complexity, and modified versions are available such as insertion, and cocktail shaker. Still, challenges exist and therefore in this research, a novel method is proposed for data sorting based on cocktail shaker sort where unnecessary swaps are reduced by checking similar values in neighbors and skipping iteration for these values like chess board knighted approaches. Hence, it reduces the number of swaps as well as time. The method is tested in three datasets and achieves a superior performance in terms of the number of swaps as well as time. It shows 81–90% improvement in the case of swaps and 40–70% superior performance in the case of CPU time. Hence, the algorithm can be used for iterative sorting. Code and datasets are available at https://github.com/niloy-999/Modified_sorting_dataset .