## K most occurring strings

Given an array arr[] of N strings and an integer K, the task is to print K strings which occurred the most number of times… Read More »

- Find the K closest points to origin using Priority Queue
- Huffman Coding using Priority Queue
- Priority Queue using Queue and Heapdict module in Python
- Length of Smallest Subsequence such that sum of elements is greater than equal to K
- Path with minimum XOR sum of edges in a directed graph
- Minimum difference between maximum and minimum value of Array with given Operations
- Array value by repeatedly replacing max 2 elements with their absolute difference
- Last element remaining by deleting two largest elements and replacing by their absolute difference if they are unequal
- K most occurring strings

Given an array arr[] of N strings and an integer K, the task is to print K strings which occurred the most number of times… Read More »

Given a positive integer M and two arrays arr[] and value[] of N and K positive integers respectively, the task is to add every element… Read More »

Given N items with weights W[0..n-1], values V[0..n-1] and a knapsack with capacity C, select the items such that: The sum of weights taken into… Read More »

Given an array arr[] of N elements, the task is to perform the following operation: Pick the two largest element from the array and remove… Read More »

Given a list of n points on 2D plane, the task is to find the K (k < n) closest points to the origin O(0,… Read More »

Given an array arr size N, the task is to print the final array value remaining in the array when the maximum and second maximum… Read More »

Given a directed graph with N nodes and E edges, a source S and a destination D nodes. The task is to find the path… Read More »

Given an array arr[] and an integer K. The following operations can be performed on any array element: Multiply the array element with K. If… Read More »

Priority Queue is an extension of the queue with the following properties. An element with high priority is dequeued before an element with low priority.… Read More »

Given an array arr[] of size N and a number K, the task is to find the length of the smallest subsequence such that the… Read More »

Prerequisite: Greedy Algorithms | Set 3 (Huffman Coding), priority_queue::push() and priority_queue::pop() in C++ STL Given a char array ch[] and frequency of each characters as… Read More »

Given an array seats[] where seat[i] is the number of vacant seats in the ith row in a stadium for a cricket match. There are… Read More »

Given an integer N and an array seats[] where N is the number of people standing in a line to buy a movie ticket and… Read More »

Given a binary array arr[], the task is to design a data structure that supports the following operations in O(1). Type 1: Remove and print… Read More »

Given an array arr[] of N non-zero positive integers and an integer K, the task is to find the XOR of the K largest prime… Read More »