60#ifndef __ADS_StackAlgorithms
61 #define __ADS_StackAlgorithms
167template< Stack S ,
class F >
226template< Stack S , Queue Q = LinkedQueue<
typename S::Item > >
237#include "ADS/stack/impl/StackAlgorithms.tpp"
The abstract data types of the book, as concepts of C++20: SEQUENCE, SET and DICTIONARY (chapter 3),...
The STACK of the book [see ADT.h] realized with a vector of a given capacity : the items are in the ...
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
A QUEUE [see ADT.h] realized as a singly linked list with a pointer to the first cell,...
The LIST of the book: a SEQUENCE [see ADT.h] realized as a bidirectional circular list of cells with ...
SequenceStack is the STACK [see ADT.h] simulated with the operations of any SEQUENCE,...
bool isMatched(std::string_view s)
whether , a string of the brackets (), [] and {}, is matched, in
void forEachBottomUp(S &s, F &&f)
f( x ) on each item , from the bottom to the top
void sortStack(S &s)
sorts with the least item on top
bool isPalindrome(const std::string &s)
whether reads the same from both ends
void reverseWithQueue(S &s)
the order of the items of reversed by a QUEUE, the only operations of being push() and pop()
void removeGreater(S &s, const typename S::Item &k)
removes the items larger than , the others in their order
bool isDyckWord(std::span< const int > w)
whether the sequence of and is a Dyck word, i.e., has no negative prefix sum