## Largest Derangement of a Sequence

Given any sequence , find the largest derangement of . A derangement is any permutation of , such that no two elements at the same… Read More »

- Find k closest numbers in an unsorted array
- Building Heap from Array
- Insertion and Deletion in Heaps
- Introduction to Data Structures | 10 most commonly used Data Structures
- Find m-th smallest value in k sorted arrays
- Find the smallest positive number missing from an unsorted array : Hashing Implementation
- Rearrange numbers in an array such that no two adjacent numbers are same
- Find the shortest distance between any pair of two different good nodes
- Uniform-Cost Search (Dijkstra for large Graphs)
- Minimize the sum calculated by repeatedly removing any two elements and inserting their sum to the Array
- TIAA Internship Experience - Pool campus for Internship
- Maximum possible sub-array sum after at most X swaps
- Reduce the array to a single integer with the given operation
- Lexicographically smallest string formed by appending a character from first K characters of a string | Set 2
- Pairing Heap

Given any sequence , find the largest derangement of . A derangement is any permutation of , such that no two elements at the same… Read More »

Binary Heap is a complete tree (All levels are completely filled except possibly the last level and the last level has all keys as left… Read More »

Given an array of n positive integers. We are required to write a program to print the minimum product of k integers of the given… Read More »

Given an array of integers. Write a program to find the K-th largest sum of contiguous subarray within the array of numbers which has negative… Read More »

Given a binary min heap and a value x, print all the binary heap nodes having value less than the given value x. Examples :… Read More »

Given n tasks with arrival time, priority and number of time units they need. We need to schedule these tasks on a single resource. The… Read More »

We are given a list of N unsorted elements, we need to find minimum number of steps in which the elements of the list can… Read More »

make_heap() is used to transform a sequence into a heap. A heap is a data structure which points to highest( or lowest) element and making… Read More »

A leftist tree or leftist heap is a priority queue implemented with a variant of a binary heap. Every node has an s-value (or rank… Read More »

Given that integers are being read from a data stream. Find median of all the elements read so far starting from the first integer till… Read More »

Given k sorted linked lists each of size n, merge them and print the sorted output. Examples: Input: k = 3, n = 4 list1… Read More »

Given a stream of integers represented as arr[]. For each index i from 0 to n-1, print the multiplication of largest, second largest, third largest… Read More »

Given an array of n numbers and a positive integer k. The problem is to find k numbers with most occurrences, i.e., the top k… Read More »

Given a binary search tree which is also a complete binary tree. The problem is to convert the given BST into a Min Heap with… Read More »

We have discussed Huffman Encoding in a previous post. In this post decoding is discussed. Examples: Input Data : AAAAAABCCCCCCDDEEEEE Frequencies : A: 6, B:… Read More »