Run Length Encoding (RLE) data compression algorithm

Run length encoding (RLE) is a very simple form of lossless data compression which runs on sequences having same value occurring many consecutive times and it encode the sequence to store only a single value and its count.

Longest Palindromic Substring

Given a string, find maximum-length contiguous substring of it that is also a palindrome. For example, the longest palindromic substring of “bananas” is “anana” and longest palindromic substring of “abdcbcdbdcbbc” is “bdcbcdb”.

Inversion count of an array

Given an array, find the number of inversions of it. If (i < j) and (A[i] > A[j]) then the pair (i, j) is called an inversion of an array A. We need to count all such pairs in the array.

Custom Sort | Sort elements by their frequency and Index

Given an array, sort its element by their frequency and index. i.e. – If two elements have the different frequencies, then the one which has more frequency should come first. – If two elements have the same frequencies, then the one which has less index should come first.

Merge Sort Algorithm

Given an array of integers, sort it using merge sort algorithm.     Merge sort is an efficient in-place sorting algorithm which produces a stable sort, which means that if two elements have the same value, they holds same relative position in the output as they did in the input.

Breadth First Search (BFS) | Iterative & Recursive Implementation

Breadth first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a ‘search key’) and explores the neighbor nodes first, before moving to the next level neighbors.