I have a linked list of integers in C, and I am trying to find an efficient way to find the most common element in the list.
So far I have thought of creating a new node structure that stores a counter, but I would like to avoid this if there is a simpler way to go about it.
Is there a more straightforward way to do this?