Question: 3. Deletion.java Read an integer >2 from keyboard, for example 25, or 2500. Use this number to determine the size of array myArray, read each

3. Deletion.java Read an integer >2 from keyboard, for example 25, or 2500. Use this number to determine the size of array myArray, read each distinctive element value one by one from the keyboard, and store/set them in this array. Delete its median value (i.e., the element at position size/2 if the size of array is odd; otherwise, two elements at positions size/2-1 and size/2). (Hint: Copy wanted elements to another array x, then use myArray = x; to reset the reference connection of myArray to the desired memory block).

At the end, apply System.out.println(Arrays.toString(myArray)) to print out the new status of such an array myArray! For instance, by given an input sequence with 3 integers 4, 1, and 2, the display will be 4 and 2. For an input sequence 4, 3, 2, and 1 with 4 integers, the display will be 4 and 1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!