|
ADS
Algorithms and Data Structures
|
the iterator on the pairs by increasing keys, with the path from the root More...
#include <ADS/tree/BTree.h>
Public types | |
| using | reference |
| a pair of constant references, the key and its value (that of the vector of the values, a proxy if V is bool), whose value is ( K , V ) | |
| using | value_type = std::pair< K , V > |
| the pairs, by value | |
| using | difference_type = std::ptrdiff_t |
| the type of the distances | |
| using | iterator_concept = std::forward_iterator_tag |
| the category of the iterator for the concepts of C++20, forward | |
| using | iterator_category = std::input_iterator_tag |
| input for the older algorithms, since *it is a value | |
Public member functions | |
| const_iterator (void)=default | |
| the end | |
| const_iterator (const Node *x) | |
| on the first key below \( x \), or at the end if \( x \) is nil or empty | |
| reference | operator* (void) const |
| the pair of the key at the end of the path | |
| const_iterator & | operator++ (void) |
| to the next key, \( O( 1 ) \) amortized and \( O( \log_t n ) \) at most | |
| const_iterator | operator++ (int) |
| to the next key, returning the iterator before the step | |
| bool | operator== (const const_iterator &o) const |
| equal on the same place of the same node, or both at the end | |
the iterator on the pairs by increasing keys, with the path from the root
| using ADS::BTree< K, V, Policy >::const_iterator::difference_type = std::ptrdiff_t |
the type of the distances
| using ADS::BTree< K, V, Policy >::const_iterator::iterator_category = std::input_iterator_tag |
input for the older algorithms, since *it is a value
| using ADS::BTree< K, V, Policy >::const_iterator::iterator_concept = std::forward_iterator_tag |
the category of the iterator for the concepts of C++20, forward
| using ADS::BTree< K, V, Policy >::const_iterator::reference |
a pair of constant references, the key and its value (that of the vector of the values, a proxy if V is bool), whose value is ( K , V )
| using ADS::BTree< K, V, Policy >::const_iterator::value_type = std::pair< K , V > |
the pairs, by value
|
default |
the end
|
inlineexplicit |
on the first key below \( x \), or at the end if \( x \) is nil or empty
|
inline |
the pair of the key at the end of the path
|
inline |
to the next key, returning the iterator before the step
|
inline |
to the next key, \( O( 1 ) \) amortized and \( O( \log_t n ) \) at most
In pseudocode (the step of PathIterator of Iterators.h on the nodes of many keys, beyond the book), \( ( x , i ) \) the last place of the path \( \pi \):
\[\class{pseudocode}{\begin{array}{r@{\quad}l} 1 & \textbf{procedure}\ \mathrm{next}() \cr 2 & \quad \textbf{if}\ x \text{ is not a leaf}\ \textbf{then}\ i \gets i + 1;\ \text{append the leftmost path from } x.c[ i ] \text{ to } \pi;\ \textbf{return} \cr 3 & \quad i \gets i + 1;\ \textbf{if}\ i < j\ \textbf{then return} \cr 4 & \quad \text{remove the places of } \pi \text{ from the end while } \text{their node has no key left at their index} \end{array}} \]
|
inline |
equal on the same place of the same node, or both at the end