Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 840 Bytes

File metadata and controls

17 lines (13 loc) · 840 Bytes

Queue

Concept

Update later...

Examples

  1. Example of Queue

Exercises

*Note: Queue always has a clear (a method is used to clear all nodes), default constructor, arguments constructor and destructor (if the language supports). Create some classes:

  • Drink and Food have name, price. Drink has private property is type = “drink” and type = “food” for Food.

Questions:

  1. Create a generic Queue has dequeue, enqueue, getSize, isEmpty. Initializer 2 queue of Drinks and Foods (each queue has arbitrary numbers of items). Perform all methods of Stack.
  2. Create a generic Queue to control the sequence of processes (callbacks, instances of class are recommended). Add perform method to perform the first Node’s task, then dequeue.