Not sure if I’m in the right thread (excuse me if I’m not), but I’d like to implement a program that prompts you to input a link to a Spotify playlist and then gives you the choice how you want it sorted (length, alphabetically…). I just wanted some advice on what data structures to use.
I’m definitely gonna use quicksort
along with insertion sort/shellsort
for subsets that are small enough. But I’m not sure what data structures to use to store/output
the songs and its desired characteristics.
I was thinking of checking first how many songs are inputted, based on that allocate an array
of structs
that holds data such as artist, song name and length (or other desired characteristics). Finally, iterating through array(n)->length
using the sorting algorithms and then outputting the sorted array
and all of its data.
I want exactly the best alternative in terms of time and space complexity, simply make it as efficient as possible. Not the easiest to implement, the best.
Thanks!
PS: I was thinking of using a hash table
to somehow implement this, potentially combined with another data structure, would that be more efficient ?
PS2: The songs and its characteristics will be in a txt file, is that considered external sorting
? If so, what approach is better if there is one ?