Algorithm returns the smallest value in the array


Discuss the below:

Q1. Using the following Array,

S = { -55.985, 14.75, .00049, 35.42, -.00049, 883.03, 19.03 }

use code (the language of your choice) to write a program to do the following Exercises

Q2 : Write an algorithm that returns the smallest value in the array. Use a for loop

Q3: Write an algorithm that outputs the largest ans second largest values in the array.

Q4 : Write an algorithm that outputs the smallest and second smallest values in the array.

Q5: Write an algorithm that outputs the smallest and largest values in the array.

 

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Algorithm returns the smallest value in the array
Reference No:- TGS01936848

Now Priced at $25 (50% Discount)

Recommended (96%)

Rated (4.8/5)