23 #ifndef SCIRE_struct_queue_HPP
24 #define SCIRE_struct_queue_HPP
37 template<
typename Type,
typename SzType>
47 virtual bool Enqueue(
const Type& element) = 0;
59 virtual Type
Front()
const = 0;
62 virtual SzType
Size()
const = 0;
85 bool Add(
const Type& element)
115 template<
typename Type,
typename SzType =
int>
117 :
public AQueue < Type, SzType >
127 bool Enqueue(
const Type& element);
147 Node(
const Type& newElement, Node *nextNode)
148 : element(newElement), next(nextNode) {}
174 while (
node !=
nullptr) {
187 if (
head ==
nullptr) {
191 if (
tail !=
nullptr) {
202 if (
head ==
nullptr)
return false;
209 if (
head ==
nullptr) {
233 template<
typename Type,
typename SzType>
235 :
public AQueue<Type, SzType>,
236 public ICrate<Type, SzType>
243 bool Enqueue(
const Type& element);
Linked List implementation of Queue.
Array implementation of Queue.
Type Fore() const
Enqueue a new element at the end of queue element element to enqueue.
Queue()
initialize a Queue object, with head and tail pointing to nullptr
bool Enqueue(const Type &element)
Enqueue a new element at the end of queue element element to enqueue.
virtual bool Enqueue(const Type &element)=0
Enqueue a new element at the end of queue element element to enqueue.
bool Dequeue()
Dequeue the an element from the front of queue.
bool Deque()
Enqueue a new element at the end of queue element element to enqueue.
virtual SzType Size() const =0
number of elements contained in
Type Front() const
Access the front (next in line) element of queue.
scire/graph/gale_shapley.hpp
SzType Size() const
number of elements contained in
bool Deduce()
deduce one element
bool Dequeue()
Dequeue the an element from the front of queue.
bool Add(const Type &element)
add an element
SzType Size() const
number of elements contained in
Type Front() const
Access the front (next in line) element of queue.
A Queue should support Enque(), Deque() and Front() operations.
bool Enque(const Type &element)
Enqueue a new element at the end of queue element element to enqueue.
virtual bool Dequeue()=0
Dequeue the an element from the front of queue.
~Queue()
finalize a Queue object by deleting all items from it
bool Enqueue(const Type &element)
Enqueue a new element at the end of queue element element to enqueue.
Type Peek() const
peek into next element contained in
Crate contains elements in an arrays.
virtual Type Front() const =0
Access the front (next in line) element of queue.