Some simple problems on Arrays

Some simple problems on Arrays

  1. 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
  2. Write a program to reverse the elements in an array.
    Eg [1,2,3,4,5] will become [5,4,3,2,1]
  3. 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)
  4. Rotate an array. [1,2,3,4,5] to [5,1,2,3,4]
  5. Find the max repeated element.
    [1,2,2,3,4,4,5,5,5,2,3,2]. Mode=2
  6. Find the longest increasing sequence.
    [12,14,16,4,5,8,9,0,3], longest increasing =[4,5,8,9]
  7. Write a program to perform Binary Search.
  8. Write a program to merge two sorted arrays.
  9. Write a program to merge 3 sorted arrays.
  10. Implement Counting Sort.


Contact us for software training, education or development










 

Post a Comment

0 Comments

Me