QueueArray sorting

Hi, is there a method in order to sort a queueArray data structure? Arduino Playground - QueueArray Library
I need a queue of byte elements that allows me to order them descending by their last 6 bits everytime I push them. So i tried with QueueArray library but it doesn't seems to have such a method... Have you got any example or any ideas to solve the problem?

You could extend the implementation and add a sortLast6bit() function which sorts the content "array" and resets the head /tail indices.

Better solution is to provide a generic sort function that uses a pointer to the compare algorithm to use (check the interface of quicksort)

For 6 elements it would be faster and use less resources to do it by hand.