|
ADS
Algorithms and Data Structures
|
The abstract data types of the book, as concepts of C++20. More...
Files | |
| file | ADS/ADT.h |
| The abstract data types of the book, as concepts of C++20: SEQUENCE, SET and DICTIONARY (chapter 3), STACK and QUEUE (chapter 4). | |
Concepts | |
| concept | ADS::Sequence |
| SEQUENCE (section 3.2.1): a dynamic linear sequence of items; as axioms, \( \mathrm{empty}( s ) = \mathrm{finished}( \mathrm{head}( s ) ) \) (empty() is redundant), \( \mathrm{read}( \mathrm{insert}( p , v ) ) = v \), \( \mathrm{remove}( \mathrm{insert}( p , v ) ) = s \), and \( \mathrm{read}( \mathrm{write}( p , v ) ) = v \) with the other items unchanged. | |
| concept | ADS::Set |
| SET (section 3.2.2): a finite collection of distinct items; union(), intersection() and difference() are functions of two sets. | |
| concept | ADS::Dictionary |
| DICTIONARY (section 3.2.3): a univocal relation from keys to values; lookup() returns the value of a key, or nothing (the nil of the book, std::nullopt). | |
| concept | ADS::Stack |
| STACK (section 4.3.1): items are added and removed at the top (LIFO). | |
| concept | ADS::Queue |
| [Stack] | |
The abstract data types of the book, as concepts of C++20.
The definitions, the invariants and the costs of the area are in Theory of the foundations.