title: How to add an element in front of Queue in java?
body: <p>I am using <code>Queue&lt;T&gt; q1</code> and I know that an element will be added using <code>q1.offer();</code> at the end of the queue. But now, what I want to do is add an element in front of queue, which is not possible with Queue. The possible methods I could think of are </p>
  
  <ul>
  <li>Use of double ended queue and I can add the elements in front and at the end. </li>
  <li>reverse the q1, add the element at the end of the queue and reverse again. </li>
  </ul>
  
  <p>Now, as a non-programmer guy, I am not sure, how to code these methods; which one is more economical and easier to do. </p>
  
  <p>Problems I faced in 1) is transform of existing Queue to Deque and vice versa; and in 2) How to use <code>Collections.reverseOrder();</code> to reverse the existing Queue. </p>