اقتباس:
المشاركة الأصلية كتبت بواسطة abo mohamed
"> q4. (2 points) write a program where you use selection sort to sort the following array in ascending order. 24,2,45,20,56,75,2,56,99,53,12 a) declare an array of integers called unsortedarr and load it with the integers above. Notice we have 11 numbers, and the number 2 is repeated which is fine. display the array as it is by printing it before the sort. b) sort the array using the insertion sort technique and display the array after you sort it. here is the beginning of the code, complete it, run it, test it, submit it. import java.util.*; public class myselectsort ** public static void main(string[] args) ** int arr[] = **24,2,45,20,56,75,2,56,99,53,12**; system.out.println("-------------------------- - unsorted"); system.out.println(arr); // continue … write your code
طيب وهذا من يتكرم ويشرحه لنا |
قرب موعد التسليم ولسا محد ساعدنا بالحل