You are on page 1of 2

Arrays

1) missing number in integer array of 1 to 100

Method 1:
 Time complexity: O(n)
 Using normal logic (n*(n+1)/2) –(summation of the given array) yields the
misiing value

Method 2:
 Time complexity: O(n)
 Using set Interface

Method 3:
 Time complexity:O(n)
 Using Hashset

Method 4:
 Time complexity: O(n)
 We find it using exor operation

Method 5: (Normal approach)


If(num==(num[i+1]-1);

Method 6: (Academic approach)-Brute force method


Time Complexity O(n2);
Most kiddy logic using 2 for loops

2) duplicate number on Integer array in Java


3) check if array contains a number in Java
4) largest and smallest number in unsorted array
5) all pairs on integer array whose sum is equal to given number
6) find repeated numbers in an array if it contains multiple duplicates
7) remove duplicates from array in Java
8) sort an array in place using QuickSort algorithm
9) find intersection of two sorted arrays in Java
10) There is an array with every element repeated twice except one. Find
that element?
11) How to find kth smallest element in unsorted array?
12) kth largest element in unsorted array
13) common elements in three sorted array
14) find the first repeating element in an array of integers
15) first non-repeating element in array of integers

You might also like