Queue/Definition
< Queue
Queue/Definition
You are encouraged to solve this task according to the task description, using any language you may know.
You are encouraged to solve this task according to the task description, using any language you may know.
Implement a FIFO queue. Elements are added at one side and popped from the other in the order of insertion.
Operations:
- push - add element
- pop - pop first element
- empty - return truth value when empty
Errors:
- handle the error of trying to pop from an empty queue (behavior depends on the language and platform)
Define the data structure for a FIFO element. Said element should contain a data member capable of holding a numeric value, and the link to the next element should be mutable.