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).

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.