## HeapSort

Heap sort is a comparison based sorting technique based on Binary Heap data structure. It is similar to selection sort where we first find the… Read More »

## Find a pair with given sum in a Balanced BST

Given a Balanced Binary Search Tree and a target sum, write a function that returns true if there is a pair with sum equals to… Read More »

## Find the number of islands | Set 1 (Using DFS)

Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5… Read More »

## Longest Palindromic Substring | Set 1

Given a string, find the longest substring which is palindrome. For example, if the given string is “forgeeksskeegfor”, the output should be “geeksskeeg”. Recommended: Please… Read More »

Given a linked list where every node represents a linked list and contains two pointers of its type: (i) Pointer to next node in the… Read More »

## Find a pair with the given difference

Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples: Input:… Read More »

## Find subarray with given sum | Set 1 (Nonnegative Numbers)

Given an unsorted array of nonnegative integers, find a continuous subarray which adds to a given number. Examples : Input: arr[] = {1, 4, 20,… Read More »

## Activity Selection Problem | Greedy Algo-1

Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate… Read More »

## 0-1 Knapsack Problem | DP-10

Given weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack.… Read More »

## N Queen Problem | Backtracking-3

We have discussed Knight’s tour and Rat in a Maze problems in Set 1 and Set 2 respectively. Let us discuss N Queen as another… Read More »

## Rat in a Maze | Backtracking-2

We have discussed Backtracking and Knight’s tour problem in Set 1. Let us discuss Rat in a Maze as another example problem that can be… Read More »

## Search in a row wise and column wise sorted matrix

Given an n x n matrix and a number x, find the position of x in the matrix if it is present in it. Otherwise,… Read More »

## Remove duplicates from a sorted linked list

Write a function which takes a list sorted in non-decreasing order and deletes any duplicate nodes from the list. The list should only be traversed… Read More »

## Write a function to get the intersection point of two Linked Lists

There are two singly linked lists in a system. By some programming error, the end node of one of the linked list got linked to… Read More »

## Find the Missing Number

You are given a list of n-1 integers and these integers are in the range of 1 to n. There are no duplicates in the… Read More »