Merl's Blog

Algorithms performances

I have been in the process of helping recreate algorithms in my own style. Along with creating an interface for linked lists and array lists.

The time has come to compare algorithmic performances on the different types of data structures, My Array List and My Linked List. The algorithms that were tested were quick sort, merge sort, and bubble sort.

Here are the results from my terminal:

Merge MyLinkedList loading… sorting… took 703 milliseconds Merge MyArrayList loading… sorting… took 257 milliseconds Quick MyLinkedList loading… sorting… took 9442 milliseconds Quick MyArrayList loading… sorting… took 287 milliseconds Bubble MyArrayList loading… sorting… took 53726 milliseconds

As you can see we are missing Bubble sort on My Linked List. Well that is because It would have taken too long on this program, and I had ran it before when I had some down time.

Bubble MyLinkedList loading… sorting… took 1 hour 24 minutes Yeah, I had a great time writing bubble sort, it was much easier than the other two but it is easy to write for a reason!

Until next time,

Merl