The seasoned taste maker

You are determined on making the most sonically pleasing playlist the world has ever heard. As a connoisseur of music, you realize that the order in which the songs are presented is just as important as the quality of the songs themselves. Your task is to compute the “best” possible order for them to appear. This shouldn't be too difficult because you are also well versed in the art of programming. For each pair of songs i i and j j you have assigned a “delight rating” d i , j d_{i,j} , which is a positive number indicating how good j j sounds when played immediately after i i . d i , j d_{i,j} and d j , i d_{j,i} are generally not equal.

Given n n songs, you write a dynamic programming solution for just finding the maximum total delight . Which of the following is a realistic run-time of the algorithm?

Details and Assumptions

  • The dynamic programming solution finds an ordering of the songs which maximizes the sum of the "delight rating" of consecutive songs. The actual ordering is not considered.
O ( 2 n n 2 ) O(2^{n}n^2) O ( 1 ) O(1) O ( lg ( n ) ) O(\lg(n)) O ( n 1.5 ) O(n^{1.5})

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

0 solutions

No explanations have been posted yet. Check back later!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...