Tag Archives: Divide & Conquer

Sorting Algorithms Explained by Examples

Introduction Today, I am going to dive into the awesome world of sorting. It reminds me with entry level computer science courses and algorithm design. The goal of this article is to summarize popular sorting algorithms and put it in …

Read more »

Introduction to Dynamic Programming

Introduction This short article is mainly for students, software engineers and those who are struggling to get a grip on the subject. In other words I will not be focusing on the theoretical side of the topic. I will first …

Read more »

Combining and Merging Two Arrays

Merging Two Arrays Problem Given two sorted arrays A and B of different sizes m and n. Describe an algorithm to combine the two arrays into one array. The output array must not have duplicates. The output array must maintain …

Read more »

Understanding Recursion

What is Recursion: Please Bear with me This is going to be a short and technical article so please bear with my bad English and writing style. Language is also a mean of communication and sometimes it fails to convey …

Read more »

Recursive Exponential Function

Problem Write a recursive function to compute (x) to the power of (n) where (x) and (n) are positive integers. Your algorithm should run in O(logn) time complexity Solution Use divide and conquer technique. For even values of (n) calculate …

Read more »

Iterative Binary Search Function

Problem Given an array of positive integers. Write an iterative version of binary search to find an element in the array Solution Binary search can be easily implemented using recursion due to the divide and conquer nature of the algorithm …

Read more »

Divide and conquer largest two elements

Divide and conquer largest two numbers problem Given an array of integers. Find the first and second largest elements in the array. Use divide and conquer technique. Divide and conquer algorithm largest two elements Simply divide the array into two …

Read more »

Page 1 of 212