array programs


1.      Write a Java program to sort a numeric array.
2.     Write a Java program to sum values of an array
3.     Write a Java program to calculate the average value of array elements.
4.     Write a Java program to test if an array contains a specific value
5.     Write a Java program to find the index of an array element
9.     Write a Java program to copy an array by iterating the array.
10.                  Write a Java program to remove a specific element from an array.
11.                   Write a Java program to reverse an array of integer values. 
13.                  Java Program to Split an Array from Specified Position
14.                  Java program to check sparse matrix.
16.                  Java program to move all zero at the end of the array.
17.                  Java program to merge two one dimensional arrays.
20.                   Write a Java program to find the duplicate values of an array of integer values
21.                  Java program to remove duplicate elements from an array.
25.                    Write a Java program to find all pairs of elements in an array whose sum is equal to a specified number.
26.                   Write a Java program to test the equality of two arrays
27.                  Write a Java program to find the number of even and odd integers in a given array of integers. 
28.                   Write a Java program to find common elements from three sorted (in non-decreasing order) arrays. 
29.                   Write a Java program to compute the average value of an array of integers except the largest and smallest values
30.                  Write a Java program to check if an array of integers without 0 and -1.
31.                  Write a Java program to remove the duplicate elements of a given array and return the new length of the array.
32.                  Write a Java program to print all the LEADERS in the array.   Go to the editor
Note: An element is leader if it is greater than all the elements to its right side.
33.                  Write a Java program to find the two elements from a given array of positive and negative numbers such that their sum is closest to zero. 
34.                  Write a Java program to find all combination of four elements of an given array whose sum is equal to a given value
35.                  Write a Java program to count the number of possible triangles from an given unsorted array of positive integers.  
36.                  Write a Java program to cyclically rotate a given array clockwise by one
37.                   Write a Java program to check whether there is a pair with a specified sum of a given sorted and rotated array.
38.                  Write a Java program to arrange the elements of an given array of integers where all negative integers appear before all the positive integers.
39.                  Write a Java program to arrange the elements of an given array of integers where all positive integers appear before all the negative integers.  
40.                  Write a Java program to sort an array of positive integers of an given array, in the sorted array the value of the first element should be maximum, second value should be minimum value, third should be second maximum, fourth second be second minimum and so on. 
41.                  Write a Java program to separate even and odd numbers of an given array of integers. Put all even numbers first, and then odd numbers.
42.                   Write a Java program to replace every element with the next greatest element (from right side) in an given array of integers.

No comments:

Post a Comment