top of page

Sorting Algorithm

Information  

The program uses the two sorting methods, insertion and merging, to organize a singly-linked list that the user may create as large and with any values that they so wish. This program incorporates the use of a singly linked list that the user navigates to insert their value nodes of choice, which is then stored until further use by the user. Then the user may either display all the values that are currently in the linked list or implement one of the two sorting methods. The first is the insertion sorting method, which loops through the values and moves the nodes(values) either left or right (if we look at the list like a line) depending on whether its value size. The second method is the merge sorting, this method splits the list into two halves, then it loops through the values and puts the node either on the left or right side of the split-point depending on whether the value is larger or smaller than the split-point’s node. This process is repeated until the list is organized smallest to largest or vice-versa. Lastly a function was added to empty/delete the nodes within the linked list so that a new one can be created for testing the other sorting method(s).

Code    

Below is the link to the code on in a Google Document

​

https://github.com/ZephielxNavares/Sorting-Algorithm

bottom of page