Maximum consecutive integers present in an array
Given an array of integers. Find the maximum number of consecutive integers present in the array. For example, if the array is: int arr[] = { 2, 24, 22, 60, 56, 23, 25}; Then the answer should be 4, because there are 4 consecutive integers present in the array (22, 23, 24, 25).
HashMap performance improvement in Java 8
What improvement has java-8 made that performance of HashMap.get() function call is fast by 20% in Java-8.
Separate Chaining: Hashing collision handling technique
It is almost impossible to design a generic hash system without collision. In case of collision, it need to be handled. There are multiple ways of handling collision. Separate chaining is one of such techniques.
Hashing introduction
Let us design a data structure in which we want to store numbers (taking it for simplicity, else it can be anything). We want to minimise the time taken by the following three operations: Insertion, time taken to insert a new value. Deletion, time taken to remove an existing value. Searching, time taken to search […]
Check if two strings are anagrams
An anagram is a word play. If letters of a word can be arranged to form another word, the two words are called anagrams. e.g MARY & ARMY are anagrams because both of them are formed of characters A, M, R and Y.