13 May Markham Saturday 14:00 Java Homework 21.05.08.
Posted at 01:15h in Saturday 14:00 Homework 0 Comments
Use either Bubble Sort, Selection Sort or Insertion sort to sort the array in ascending order by using the absolute value. Please refer to this link https://en.wikipedia.org/wiki/Absolute_value if you don’t know what absolute value is
Also, If the array has a specific number which contains both its negative form and the positive form, the sorting algorithm should put the number with the negative form of the number before the positive form
Input [1,2,3 -2, 0 , -1, -2, 4] Output [ 0, -1, 1, -2, -2, 2, 3, 4]
Sorry, the comment form is closed at this time.