Python Code to Reduce and Compress Image Files

As a large number of Internet users use cell phones to access online contents, Google started penalizing the websites that are slow and take several seconds to download all the data. If your web pages have only text data, you may not have to worry. …

Extended Euclid algorithm for GCD in Python

Euclid’s recursive program based algorithm to compute GCD (Greatest Common Divisor) is very¬†straightforward. If we want to compute gcd(a,b) and b=0, then return a, otherwise, recursively call the function using a=b and b=a mod b.

Quick Sort Algorithm in Python

Quicksort, aka partition-exchange sort, is a divide and conquer algorithm. It’s an efficient algorithm that takes O(nlogn) time to sort n items (on average). In the worst case, it might take O(n2) time.Quicksort first divides a large list/array into two smaller sub-arrays using a pivot …