Given an array with n distinct elements, convert the given array to a form where all elements are in range from 0 to n-1. The… Read More »
Given an array of integers and a number k, write a function that returns true if given array can be divided into pairs such that… Read More »
Given an array of distinct integers, find if there are two pairs (a, b) and (c, d) such that a+b = c+d, and a, b,… Read More »
Two pairs (a, b) and (c, d) are said to be symmetric if c is equal to b and a is equal to d. For… Read More »
Given an array of integers, find length of the largest subarray with sum equals to 0.
Given an array of integers, find the length of the longest sub-sequence such that elements in the subsequence are consecutive integers, the consecutive numbers can… Read More »
We strongly recommend to refer below post as a prerequisite of this. Hashing | Set 1 (Introduction) Hashing | Set 2 (Separate Chaining)
Given an array of size n and an integer k, return the of count of distinct numbers in all windows of size k.
We strongly recommend to refer below post as a prerequisite of this. http://quiz.geeksforgeeks.org/hashing-set-1-introduction/
Given a list of tickets, find itinerary in order using the given list. Example: Input: “Chennai” -> “Banglore” “Bombay” -> “Delhi”
Given a dictionary that contains mapping of employee and his manager as a number of (employee, manager) pairs like below.
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 »
Hash Table supports following operations in Θ(1) time.
Given an unsorted array with repetitions, the task is to group multiple occurrence of individual elements. The grouping should happen in a way that the… Read More »
Given an unsorted array that may contain duplicates. Also given a number k which is smaller than size of array. Write a function that returns… Read More »