Write a function named "swap_largest_smallest" that takes as its arguments the following:
(1) An array of integer values. (2) An integer that tells how many integer values are in the array.
The function should swap the largest number stored in an array with the smallest number stored in an array and vice versa. For example, if the array that's passed to the function looks like this: 8 | 26 | 90 | 34 | 71
The function should update the array as: 90 | 26 | 8 | 34 | 71
If there is more than one cell containing the largest of the values in the array, then the function should consider smallest of the subscripts/index of the cells containing the largest values. For example, if the array that's passed to the function is 58 | 26 | 91 | 34 | 70 | 91 | 88
The function should update the array as: 58 | 91 | 26 | 34 | 70 | 91 | 88
The post Write a function named “swap_largest_smallest” that takes as its arguments the following: (1) An… appeared first on Nursing Essay Tutors.
Write a function named “swap_largest_smallest” that takes as its arguments the following: (1) An… was first posted on June 28, 2024 at 9:18 pm.©2019 "nursingassignmenttutor". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at administrator@cheapcustomwriting.com