I am current developing a karaoke app in JavaFX, I need advise on the most optimal data structure storing a huge list of songs (library). I am inclined to use Binary Search Trees due to its Big O Performance of O(log(n)).
I am using the String compareTo
function in Java for insertion but searching proves difficult with compareTo
. Therefore, I am not sure that is the best for searching though strings.
I am using https://www.bigocheatsheet.com/ for Big O Performance Metrics.
Should I just ditch Binary Search Trees or use an another simple structure like List? (However performance will be O(n))
Song Data & Sorting: I load the sample song data provided to me by loading the file and storing it into the data structure. I want to search only by Song Name (Using Java String Contains
method) since it's a basic program. Here is the sample song data:
Decades (2007 Remaster) Joy Division 374 test.mp4
Lets Stay Together Al Green 199 test.mp4
Jump For Joy New York Trio 286 test.mp4
Victims Of The Revolution Bad Religion 197 test.mp4
Unstable Condition John Tejada 348 test.mp4
Go or Linger Natas loves you 173 test.mp4
Ocean Front Property George Strait 197 test.mp4
Negai (Album-Mix) Perfume 298 test.mp4
A Little Bit More Jamie Lidell 186 test.mp4
Good Position Yin Yoga Academy 219 test.mp4
Weekend Kane Brown 226 test.mp4
Oh Industry Bette Midler 244 test.mp4