## Count inversions of size k in a given array

Given an array of n distinct integers and an integer k. Find out the number of sub-sequences of a such that , and . In… Read More »

- Sort the array of strings according to alphabetical order defined by another string
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Number of subarrays have bitwise OR >= K
- Count of words that are present in all the given sentences
- Range Sum Queries and Update with Square Root
- Count of strings whose prefix match with the given string to a given length k
- Given an array and two integers l and r, find the kth largest element in the range [l, r]
- Count pairs (A, B) such that A has X and B has Y number of set bits and A+B = C
- Range and Update Sum Queries with Factorial
- Range Queries to Find number of sub-arrays with a given xor
- Lazy Propagation in Segment Tree | Set 2
- Persistent Trie | Set 1 (Introduction)
- Program to implement Run Length Encoding using Linked Lists
- Queries for Composite numbers in subarray (With Point Updates)
- Find a pair from the given array with maximum nCr value
- Find triplet such that number of nodes connecting these triplets is maximum
- Queries to update a given index and find gcd in range
- B-Tree Insert without aggressive splitting
- Introduction to R-tree
- Arrange array elements such that last digit of an element is equal to first digit of the next element
- Find the number of different numbers in the array after applying the given operation q times
- Index of kth set bit in a binary array with update queries

Given an array of n distinct integers and an integer k. Find out the number of sub-sequences of a such that , and . In… Read More »

Given a binary tree and 3 nodes a, b and c, the task is to find a node in the tree such that after removing… Read More »

Given a BST, the task is to find the sum of all elements greater than or equal to K-th largest element in O(1) space. Examples:… Read More »

Given a string array of M words and a dictionary of N words. The task is to check if the given string of words can… Read More »

sklearn.preprocessing.Binarizer() is a method which belongs to preprocessing module. It plays a key role in the discretization of continuous feature values. Example #1: A continuous… Read More »

Given an array of n elements and q range queries (range sum in this article) with no updates, task is to answer these queries with… Read More »

Prerequisite – Hashing Introduction, Hashtable using Singly Linked List & Implementing our Own Hash Table with Separate Chaining in Java Implementing hash table using Chaining… Read More »

Coalesced hashing is a collision avoidance technique when there is a fixed sized data. It is a combination of both Separate chaining and Open addressing.… Read More »

Given an array of N numbers and Q queries, each query consists of L and R. We need to write a program that prints the… Read More »

Self-Balancing Binary Search Trees are height-balanced binary search trees that automatically keeps height as small as possible when insertion and deletion operations are performed on… Read More »

Given a binary tree, the task is to find the distance between two keys in a binary tree, no parent pointers are given. Distance between… Read More »

Inverted Index It is a data structure that stores mapping from words to documents or set of documents i.e. directs you from word to document.… Read More »

Euler tour of tree has been already discussed which flattens the hierarchical structure of tree into array which contains exactly 2*N-1 values. In this post,… Read More »

Given a binary tree, the task is to find the distance between two keys in a binary tree, no parent pointers are given. The distance… Read More »

A Levelwise GCD/LCM alternating segment tree is a segment tree, such that at every level the operations GCD and LCM alternate. In other words at… Read More »