Solution for problem 4E Chapter 3.1
Describe an algorithm that takes as input a list of n
Discrete Mathematics and Its Applications | 7th Edition
Describe an algorithm that takes as input a list of n integers and produces as output the largest difference obtained by subtracting an integer in the list from the one following it.
Solution:Step 1In this problem we need to write an algorithm which takes a list of n integers as input and produce the largest difference between the consecutive integers as the output.