[Solved]Top Songs Devise Algorithm Implement Program Solve Following Problem Similar One Often Fac Q37181880
Top songs
Devise an algorithm and implement it in a program to solve thefollowing problem, similar to one often faced bya n MP3 player.Please can anyone convert this algorithm into either python or javaprogram.
Input is
3
&
Pink Frost&Phillipps, Martin&234933
Se quel guerrier io fossi&Puccini, Giacomo&297539
Non piu andrai&Mozart&234933
M’appari tutt’amor&Flotow, F&25290
Output is
Se quel guerrier io fossi&Puccini, Giacomo&297539
M’appari tutt’amor&Flotow, F&252905
Non piu andrai&Mozart&23493

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 k with 1 SkK n. Your program must find the k 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 You should first make sure that your algorithm and implementation are correct! It is up to you to come up with test cases and the corresponding correct output. Usually, if a program contains an error, this can be detected on a small test case. You are allowed to share test cases with the class via the class forum Next you should consider efficiency. Remember that the test cases may use any value of k and n . Please see below for information on input and output formats Show transcribed image text 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 k with 1 SkK n. Your program must find the k 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 You should first make sure that your algorithm and implementation are correct! It is up to you to come up with test cases and the corresponding correct output. Usually, if a program contains an error, this can be detected on a small test case. You are allowed to share test cases with the class via the class forum Next you should consider efficiency. Remember that the test cases may use any value of k and n . Please see below for information on input and output formats
Expert Answer
Answer to Top songs Devise an algorithm and implement it in a program to solve the following problem, similar to one often faced b… . . .
OR

