Data Structure - Array
5) In an array 1-100 numbers are stored, one number is missing how do you find it?
6) In an array 1-100 exactly one number is duplicate how do you find it?This article contains a trick to find duplicates in Array using Java programming language
7) In an array 1-100 many numbers are duplicates, how do you find it?trick in this programming questions is by using hashmap or hashtable , we can store number as key and its occurrence as value, if number is already present in hashtable then increment its value or insert value as 1 and later on print all those numbers whose values are more than one.
8) Given two arrays, 1,2,3,4,5 and 2,3,1,0,5 find which number is not present in the second array.Here is a quick tip to solve this programming question: put the elements of the second array in the Hashtable and for every element of the first array, check whether it’s present in the hash or not, O/P all those elements from the first array that are not present in the hash table
9) How do you find second highest number in an integer array?