## Rearrange numbers in an array such that no two adjacent numbers are same

Given an array of integers. The task is to rearrange elements of the array such that no two adjacent elements in the array are same.… 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
- 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]
- Lazy Propagation in Segment Tree | Set 2
- Range Queries to Find number of sub-arrays with a given xor
- Persistent Trie | Set 1 (Introduction)
- Longest string in an array which matches with prefix of the given string
- Program to implement Run Length Encoding using Linked Lists
- Introduction to R-tree
- Queries for Composite numbers in subarray (With Point Updates)
- Queries to update a given index and find gcd in range
- Find triplet such that number of nodes connecting these triplets is maximum
- Rearrange numbers in an array such that no two adjacent numbers are same
- Find a pair from the given array with maximum nCr value
- B-Tree Insert without aggressive splitting
- Find the number of different numbers in the array after applying the given operation q times
- Arrange array elements such that last digit of an element is equal to first digit of the next element
- Index of kth set bit in a binary array with update queries

Given an array of integers. The task is to rearrange elements of the array such that no two adjacent elements in the array are same.… Read More »

Given an array of strings arr[] and Q queries where each each query consists of a string str, the task is to find the longest… Read More »

Given an array of size N, initially consists of zeroes only. The task is to apply given operation q times and find the number of… Read More »

Prerequisite: Trie Persistency in Data Structure Trie is one handy data structure that often comes into play when performing multiple string lookups. In this post,… Read More »

B-Tree Insert without aggressive splitting This algorithm for insertion takes an entry, finds the leaf node where it belongs, and inserts it there. We recursively… Read More »

Given a binary array arr[] and q queries of following types: k: find the index of the kth set bit i.e. kth 1 in the… Read More »

Given an array arr[] of integers, the task is to arrange the array elements such that the last digit of an element is equal to… Read More »

Given an array of strings arr[] and given some queries where each query consists of a string str and an integer k. The task is… Read More »

Given an array arr[] of N integers and queries Q. Queries are of two types: Update a given index ind by X. Find the gcd… Read More »

R-tree is a tree data structure used for storing spatial data indexes in an efficient manner. R-trees are highly useful for spatial data queries and… Read More »

Given a Tree with N nodes, the task is to find a triplet of nodes (a, b, c) such that the number of nodes covered… Read More »

Given an array arr[] of size n and q queries and an integer k. Each query consists of an index range [l, r] and the… Read More »

Given an array arr[] of size N. There are two types of operations: Update(l, r, x) : Increment the a[i] (l <= i <= r)… Read More »

Given an unsorted array arr[] of n integers and an integer k, the task is to find the kth largest element in the given index… Read More »

Given an array arr[] of n positive integers. The task is to find elements arr[i] and arr[j] from the array such that arr[i]Carr[j] is maximum… Read More »