Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using DataStructures.LinkedList;
- namespace DataStructures.Queue
- {
- public class Queue<T>
- {
- public int Count
- {
- get { return this.Elements.Count; }
- }
- private GenericLinkedList<T> _elements;
- public GenericLinkedList<T> Elements
- {
- get { return _elements; }
- set { _elements = value; }
- }
- public Queue()
- {
- this.Elements = new GenericLinkedList<T>();
- }
- public bool isEmpty()
- {
- return this.Count == 0;
- }
- public void Enqueue(T newElement)
- {
- this.Elements.Push_Back(newElement);
- }
- public T Dequeue()
- {
- return this.Elements.Pop_Front();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement