![]() | |
Project 4: Assigned: Fri Apr 04 2025 Your younger sibling just found out about rock music because they signed up for a website and have been making a list of their favorite songs. They have started asking you to make cool mixes of their playlist of favorite songs. You super want them to leave you alone, so you finally relent. After fidling around with the website for a few minutes, you realize the playlist creator is dumb and you can't reorder songs. You also know that if you pick any two songs that are adjacent in the list, your sibling will complain that it's too similar to their list. You realize that the best thing to do is to create the longest playlist you can to occupy your sibling without picking neighboring songs. Part 0, 0 points: Look at the instructions below to organize your code to simplify the submission process. Part 1, 0 points: Create a new file, SongSelector.java, in which you will add a static method, Part 2, 0 points: Add a JavaDoc comment header to describe your project and list who is in your team. Additionally, add a method to your class,
Part 3, 0 points: You'll need these files in order to run the tester: Part 4, 100 points: Your grade will be based on the longest song lists that you can correctly find the longest sublist for in a restricted amount of time. Here is my SongSelectorTester.java, which will run your code on increasingly larger lists of song lengths. It does not check the validity of larger trials due to time constraints. (If you submit it to me, I will be able to check the validity.) Important notes:
Part 5, 0 points: You can start with the brute-force algorithm here, in order to earn some points and make sure you know how everything works. Part 6, 0 points: In order to score all of the points, I think you will need to use dynamic programming. Here's a hint for your scheme: any time you choose to include a song, you have to skip the songs before and after it. Sometimes you won't want to skip just one song, but two. However, you will never want to skip three songs, as you could increase the length by including that song in the middle of those three. If you can't come up with the scheme, please come and talk to me so I can help you. Part 7, 0 points: I did not get a speedup from using multiple processors for this project, but you are welcome to try using them. Submitting your Project: The files I'm looking for in this project are: |