Devise an algorithm and implement it in a program to solve the following problem, similar to one
Question:
Devise an algorithm and implement it in a program to solve the following problem, similar to one often faced by an MP3 player. For our purposes, a song consists of the following data fields: title (a nonempty ASCII string), composer (a (possibly empty) ASCII string), running time (a positive integer). Input consists of n songs and an integer with 1 〈 k 〈 n. Your program must find the songs with longest running times, and output these songs in descending order of length of song. If songs have the same running time, then we use lexicographic order on the title, and then on the composer, to get a total ordering. The lexicographic order comes from the usual order on ASCII characters Instruction: the first line gives the integer k, and the second line a separator character that is not contained in any of the song or composer strings. The sub sequence lines give the song data, with fields separated by the separator character
Managerial Decision Modeling with Spreadsheets
ISBN: 978-0136115830
3rd edition
Authors: Nagraj Balakrishnan, Barry Render, Jr. Ralph M. Stair