Divide method of sorting records or numbers
Main Article Content
Abstract
To sort a list of numbers there are few methods whereas the Divide and sort method at first divides the list of numbers into three groups rather two arrays and a variable. The numbers are compared with respect to the first element. The numbers lesser to the first element are kept in an array. The greater numbers are kept in a separate array and the numbers which are equal to the first element are counted and the value is set in a variable. Now the two arrays are sorted separately by any other method. Now the lists are merged accordingly, list of lesser numbers are kept first, then the numbers which are equal to first element are kept and then the numbers which are greater than the first element are kept after it. Then the list is printed or kept in an array of variables. As the numbers are divided before sorting the method is named as “Divide and Sort†method. The complexity of this process is 1/3rd of other methods of quadratic running time. Best case is when all the numbers are same. That case can be checked by this method.
Â
Â
Keywords: divide and sort method, time complexity, sorting method, sorting cost, three variables
Downloads
Article Details
COPYRIGHT
Submission of a manuscript implies: that the work described has not been published before, that it is not under consideration for publication elsewhere; that if and when the manuscript is accepted for publication, the authors agree to automatic transfer of the copyright to the publisher.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work
- The journal allows the author(s) to retain publishing rights without restrictions.
- The journal allows the author(s) to hold the copyright without restrictions.