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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started