diff --git a/queue.md b/queue.md index 725af108..dc9f7cce 100644 --- a/queue.md +++ b/queue.md @@ -5,7 +5,7 @@
  1. pop
  2. back
  3. -
  4. push
  5. +
  6. push
  7. size
  8. swap
  9. empty
  10. @@ -14,4 +14,24 @@
  11. queue
  12. ~queue
- \ No newline at end of file + + +# push +**Description** : push() function is used to insert an element at the back of the queue. The element is added to the queue container and the size of the queue is increased by 1. + +**Example**: +```cpp + // Empty queue + queue myqueue; + + // pushing elements into queue using push() + myqueue.push(0); + myqueue.push(1); + myqueue.push(2); + + // print contents of queue + while (!myqueue.empty()) { + cout << ' ' << myqueue.front(); + myqueue.pop(); + } +``` \ No newline at end of file