I am creating a music playlist where each song is given a rank (not unique). The highest rated song will eventually be played and leave the queue. The catch is, each song can be up voted or down voted to change its rank, thus changing the order of the queue. Is there an ideal data structure for this behavior in elixir?
I have considered a list of song structs, but swapping elements in a list is not ideal. But to maintain order I can’t have a map of structs. Any help would be appreciated! (I’m new to elixir)