Hanan DSA
Hanan DSA
Write a Java program that takes an array of integers and a target integer as input and returns the
index of the target integer in the array. If the target integer is not found, return -1.
2. Write a Java program that takes an array of integers as input and returns the maximum element in
the array.
3.Write a Java program that takes an array of integers as input and returns the minimum element in the
array.
4. Write a Java program that takes an array of integers as input and returns the sum of all elements in
the array.
5. Write a Java program that takes an array of integers and two indices as input and swaps the elements
at the specified indices in the array.