Fill in the blanks for a selection sort that results in a descending sort (largest to smallest) and the selection finds
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Fill in the blanks for a selection sort that results in a descending sort (largest to smallest) and the selection finds
Fill in the blanks for a selection sort that results in a descending sort (largest to smallest) and the selection finds the maximum value. public static void selection Sort( int vec[] ) { int maxPos; // Index of largest after each pass. int top; int temp; for (top = ; top<vec.length top++) { maxPos = for (next = top+1; i < vec.length; next { if (vec[ ] > vecí ]) maxPos = ; } = vecí ]; vec[ ] = vec[maxPos]; vec[maxpos] = ; } }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!