Skip to content

Queue data structure #60

@TheSTL

Description

@TheSTL

Need following functions in queue:

File location - Queue

  1. empty() – Returns whether the queue is empty.
  2. size() – Returns the size of the queue.
  3. front() – Function returns a the first element of the queue.
  4. back() – Function returns a the last element of the queue.
  5. push(g) – Function adds the element ‘g’ at the end of the queue.
  6. pop() – Function deletes the first element of the queue.

Example:

Queue q = [1,2,3,4,5,6];
q.empty() false
q.size() 6
q.front() 1
q.back() 6
q.push(10) [1, 2, 3, 4, 5, 6, 10]
q.pop() [2, 3, 4, 5, 6, 10]

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions