A New Design Pattern for Sorting Algorithms
Khalid Imam Rahmani, Zakir Husssain · 2010
In this paper we have proposed an object oriented framework for implementing and visualization of comparison based sorting algorithms and linear gradient function based sorting algorithm. We model comparison based sorting as an abstract class with an abstract method to perform the arrangement of elements. Splitting and combining of arrays are done by the concrete subclasses. Performance measurements and visualizations can be added without modifying any code by using the decorator design pattern. Our design not only provides a concrete way of unifying different sorting algorithms but also help to analyze them at the proper level of abstraction. The framework can also be adapted to implement a gradient function based sorting algorithm.