# Tag: Hashing

## Link nodes present in each level of a binary tree in the form of a linked list

Given a binary tree, write an efficient algorithm to link nodes at the same level in the form of a linked list like structure.

## Find preorder traversal of a binary tree from its inorder and postorder sequence

Write an efficient algorithm to find preorder traversal of a binary tree from its inorder and postorder sequence without constructing the tree.

## Calculate frequency of all elements present in an array of specified range in linear time and using constant space

Given an unsorted array of integers whose each element lies in range 0 to n-1 where n is the size of the array, calculate the frequency of all elements present in the array in linear time and using constant space.

## Replace each element of the array by its corresponding rank in the array

Given an array of distinct integers, replace each element of the array by its corresponding rank in the array.

## Find all common elements present in every row of given matrix

Given a M x N matrix, find all common elements present in every row.

## Group elements of an array based on their first occurrence

Given an unsorted array of integers containing many duplicates elements, rearrange the given array such that same element appears together and relative order of first occurrence of each element remains unchanged.

## Find all Symmetric Pairs in an Array of Pairs

Given an array of pairs of integers, find all symmetric pairs i.e. pairs that are mirror of each other. For instance, pairs (x, y) and (y, x) are mirrors of each other.

## Construct the longest palindrome by shuffling or deleting characters from a string

Write a efficient algorithm to construct the longest palindrome by shuffling or deleting characters from a given string.

## Find count of distinct elements in every sub-array of size k

Given an array and an integer k, find the count of distinct elements in every sub-array of size k in the array.

## Print all sub-arrays of an array having distinct elements

Given an array of integers, print all maximum size sub-arrays having all distinct elements in them.

## Find Minimum Index of Repeating Element in an Array

Given an array of integers, find minimum index of a repeating element in linear time and doing just one traversal of the array.

## Find Index of Maximum Occurring Element with Equal Probability

Given a collection of integers, develop an algorithm to find the index of maximum occurring element with equal probability.