Some simple problems on Arrays
Some simple problems on Arrays
- Given an array you are required to find the missing elements.
Eg [1,2,3,5,6,8,9,10].The missing elements are 4 and 7 - Write a program to reverse the elements in an array.
Eg [1,2,3,4,5] will become [5,4,3,2,1] - Find the Kth largest and Kth smallest element in an array?
Eg a=[1,2,3,4,4,5,6,7,8,9], k-3 will give (3,7) - Rotate an array. [1,2,3,4,5] to [5,1,2,3,4]
- Find the max repeated element.
[1,2,2,3,4,4,5,5,5,2,3,2]. Mode=2 - Find the longest increasing sequence.
[12,14,16,4,5,8,9,0,3], longest increasing =[4,5,8,9] - Write a program to perform Binary Search.
- Write a program to merge two sorted arrays.
- Write a program to merge 3 sorted arrays.
- Implement Counting Sort.
0 Comments