## Average of remaining elements after removing K largest and K smallest elements from array

Given an array of N integers. The task is to find the average of the numbers after removing k largest elements and k smallest element… Read More »

## Sum and product of k smallest and k largest composite numbers in the array

Given an integer k and an array of integers arr, the task is to find the sum and product of k smallest and k largest… Read More »

## Average of max K numbers in a stream

Given a list of ‘N’ numbers, and an integer ‘K’. The task is to print the average of max ‘K’ numbers after each query where… Read More »

## Find the second last node of a linked list in single traversal

Given a linked list. The task is to find the second last node of the linked list using a single traversal only. Examples: Input :… Read More »

## Find K items with the lowest values

Given a list of items and their values. The task is to find k items with the lowest value. It is possible that two items… Read More »

## kth smallest/largest in a small range unsorted array

Find kth smallest or largest element in an unsorted array, where k<=size of array. It is given that elements of array are in small range.… Read More »

## Multi-set for user defined data type

You are given Q queries. Each query contains an integer k and a person’s information i.e, first name, last name, age. For each query, we… Read More »

## Sampling Theory

In the world of Statistics, the very first thing to be done before any estimation is to create a Sample set from the entire Population… Read More »

## K’th Largest element in BST using constant extra space

Given a binary search tree, task is to find Kth largest element in the binary search tree. Input : k = 3 Root of following… Read More »

## Find k-th smallest element in given n ranges

Given n and q, i.e, the number of ranges and number of queries, find the kth smallest element for each query (assume k>1).Print the value… Read More »

## Top three elements in binary tree

We have a simple binary tree and we have to print the top 3 largest elements present in the binary tree. Examples: Input : 1… Read More »

## K maximum sums of overlapping contiguous sub-arrays

Given an Array of Integers and an Integer value k, find out k sub-arrays(may be overlapping) which have k maximum sums. Examples: Input : arr… Read More »

## K maximum sums of non-overlapping contiguous sub-arrays

Given an Array of Integers and an Integer value k, find out k non-overlapping sub-arrays which have k maximum sums. Examples: Input : arr1[] =… Read More »

## K maximum sum combinations from two arrays

Given two equally sized arrays (A, B) and N (size of both arrays). A sum combination is made by adding one element from array A… Read More »

## Python heapq to find K’th smallest element in a 2D array

Given an n x n matrix and integer k. Find the k’th smallest element in the given 2D array. Examples: Input : mat = [[10,… Read More »