An implementation of priority stack based on a red-black tree concept
The data is stored in a red-black tree with nodes containing priority value and a LIFO-stack instance for storing values of the same priority. Memory is allocated and freed dynamically. Both Pop and Push operations require time O(log(n)). Clear operation requires O(n) time.