## Fibonacci Heap | Set 1 (Introduction)

Heaps are mainly used for implementing priority queue. We have discussed below heaps in previous posts. Binary Heap Binomial Heap In terms of Time Complexity,… 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

Heaps are mainly used for implementing priority queue. We have discussed below heaps in previous posts. Binary Heap Binomial Heap In terms of Time Complexity,… Read More »

We strongly recommend to refer below posts as a prerequisite of this. K Dimensional Tree | Set 1 (Search and Insert) K Dimensional Tree |… Read More »

We strongly recommend to refer below post as a prerequisite of this. K Dimensional Tree | Set 1 (Search and Insert) In this post find… Read More »

Segment tree is introduced in previous post with an example of range sum problem. We have used the same “Sum of given Range” problem to… Read More »

How to design a system that takes big URLs like “https://www.geeksforgeeks.org/count-sum-of-digits-in-numbers-from-1-to-n/” and converts them into a short 6 character URL. It is given that URLs… Read More »

Design a data structure that supports following operations in Θ(1) time. insert(x): Inserts an item x to the data structure if not already present. remove(x):… Read More »

Unlike C++ and Java, C doesn’t support generics. How to create a linked list in C that can be used for any data type? In… Read More »

Given a string, find the longest substring which is palindrome. We have already discussed Naïve [O(n3)], quadratic [O(n2)] and linear [O(n)] approaches in Set 1,… Read More »

We have discussed implementation of Reverse DNS Look Up Cache. Forward DNS look up is getting IP address for a given domain name typed in… Read More »

Let us consider the following problem to understand Binary Indexed Tree. We have an array arr[0 . . . n-1]. We would like to 1… Read More »

Reverse DNS look up is using an internet IP address to find a domain name. For example, if you type 74.125.200.106 in browser, it automatically… Read More »

Given two strings X and Y, find the Longest Common Substring of X and Y. Naive [O(N*M2)] and Dynamic Programming [O(N*M)] approaches are already discussed… Read More »

In earlier suffix tree articles, we created suffix tree for one string and then we queried that tree for substring check, searching all patterns, longest… Read More »

Given a string, build it’s Suffix Array We have already discussed following two ways of building suffix array: Naive O(n2Logn) algorithm Enhanced O(nLogn) algorithm Please… Read More »

Given a text string, find Longest Repeated Substring in the text. If there are more than one Longest Repeated Substrings, get any one of them.… Read More »