15-121 Introduction to Data Structures Lab 2 Exercise Arrays An array is a data structure which stores a fixed number of elements of a single type. 1. Create a class called ArrayOperations. 2. Declare a string array which contains the words of the sentence “I love programming in Java”. 3. Now display each element in the array on a different line, using a foreach loop, so the output is of the form: I Love Programming In Java 4. Next, display the words in reverse order using a for loop. Array operations: 1. Declare an array of integers containing the following values: 12,5,19,35,22,6,90,100,73,37 2. Insert the number 45 at the 3rd index, by shifting the numbers 35,22,... by 1 index position. Note that 37 will no longer be in the array. The new array should now be 12,5,19,45,35,22,6,90,100,73. 3. Write code to find out the maximum element of the array(Hint: You may start off by assigning the element at index 0 to a variable called max. Now compare it with every other element in the array. If you find a number that is greater than max, then change the value of max to that number.) 4. Find out the minimum element of the array. 5. Find out the average of the numbers in the array. 6. Write code to search for the number 100 within the array. If the number is found, return the index of the number. If the number is not found, print “Number not found to the console”. 7. For searching for an element in an array, what is Best case complexity: ______ Worst case complexity: ______