Tag: Divide and Conquer

Python recursive function examples

Table of contents Recursive exponential Recursive max Recursive multiplication Recursive sum Recursive average Recursive uppercase Recursive exponential Given two exponential numbers with the same base, the multiplication is another exponential number with the same base but we add the exponents. We can utilize this observation and define a recursive exponential formula. If (n) is even

Merge sort in Python

Problem Implement merge sort algorithm in Python. Solution For definition and explanation, You may refer to the following post. This post is just a rewrite in Python. Before jumping directly to the code, check out the following nice YouTube clip Recursive merge sort in python Take a look at the comments for explanation… Thanks for