Compiled from: Introduction To The Design and Analysis of Algorithms Second Edition by Anany Levitin Algorithmics: The Spirit of Computing …