Define queue. Explain the various operations performed in queue with the help of an example.
Answers
Answered by
2
A queue is a list of jobs that are awaiting to be processed. When a job is sent to a queue, it is simply added to the list of jobs. Computer programs often work with queues as a way to order tasks.
A queue has all the same operations that any data structure like an array or linked list has.
Traversal- This is the process of accessing each and every element of the queue.
Enque- This is an operation where you can add an element to the end of the queue.
Deque- This is an operation where you can delete an element from the starting of the queue.
Searching- You can search through the queue for an element of your choice and display it's position in the queue.
Merging- You can merge two queues together, one behind the other.
Similar questions