In a queue, where elements in integers are added, how do i do this:
Inside the queue:
1 2 3 5 6 8
when I want to add a number, say 4, the output should be like:
1 2 3 4 5 6 8
in which it inserts in between 2 and 5. Queues are FIFO but somehow this doesn't make sense. I think this has something to do with priority. the example above is just an ordinary queue, not to confused with a priority queue..
Can someone explain and help me?