Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

DSA Tutorial

Tutorial 3
Basic

Topic: Array - 1
[ write a java program to perform following Questions]
[ Generate Random Array for Following Problems Using java.util.Random]
(generating Array is preferable not necessary)

1) Remove all duplicate elements in an array , replace elements with 0.

2) Find Second Maximum Element in Array

3) Find Sum of all element in Array in recursive method.

4) Find an element with highest frequency in an array, also print its frequency.

5) Count the no. of Odd and Even elements separately

6) Check weather the given Array is Sorted or nor ( both asc and desc )

7) Print all elements of an array that can divisible by length of array.

8) Check weather two arrays are Identical or not. ( Same elements but it can in
different order)

9) Find average of all prime elements in array.

10) Find a pair of two elements in an array, such that their sum is prime number
and has maximum sum.
Welcome to the wonderful World of Java. Decoded by Moksh Patel ...!

1|Page
Welcome to the wonderful World of Java. Decoded by Moksh Patel ...!

2|Page

You might also like