Introduction: Ternary Search is an divide and conquer algorithm. Explanation of the algorithm: Like in binary search, we always divide the array into 2 parts, in Ternary Search as the name suggests we divide the array into 3 parts. So how do we calculate the 3 …

Introduction: Exponential search is an improvement to binary search. We use this algorithm when we have lange amount of data. Explanation: In exponential search algorithm we use binary search. But the difference is, we get the range of elements to search from and give that as …

Introduction: Interpolation search is an improvement to binary search. This will help to achieve better time complexity. Explanation: As we have seen in the binary search chapter, we always take the middle index and based on it, we shift towards left or right. But what if …

Introduction: Comb sort is an improvement on bubble sort As you know bubble sort will sort adjacent elements, comb sort will use the gap to sort the element. At each pass the gap will be reduced by 1.3 until it reaches to 1. Thus sorting the …

Topological sort is used on Directed Acyclic Graph. Here the sorting is done such that for every edge u and v, for vertex u to v, u comes before vertex v in the ordering. If the graph has a cycler if the graph us undirected graph, …

In this tutorial we shall solve a very famous problem “House Robber” problem. This problem can be solved by using DP method. Problem Statement: You are given an array of +ve numbers that represents amount present inside the house, you need to rob the house such …