Tag Archives: python

Merge Sort Python Iterative and Recursive implementations

Merge sort is a famous sorting algorithm with guarantee running time N Log N. However, this algorithm uses extra space equivalent to N. The algorithms uses a divide and conquer approach where an is divided in two and sorted, then the two sorted halves are merged. This post shows the Merge Sort Python implemented in two ways: Recursively and Iteratively. The implementation were done in Python to explore a different approach than the traditional C and Java languages.

Continue reading

QuickSort Python Iterative and Recursive implementations

QuickSort is one of the most famous sorting algorithms in computer science. I implemented the QuickSort in Python using two approaches including Recursive QuickSort and Iterative QuickSort.

The implementation were done in Python to explore a different approach than the traditional C and Java languages. Finally I scored the average running time obtained by running multiple times each approach.
Continue reading