|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Utility functions for array manipulation. More...
#include <cstdlib>#include <cassert>#include <stdexcept>#include <ah-errors.H>#include <iostream>#include <utility>Go to the source code of this file.
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
Functions | |
| template<class Tarray > | |
| void | Aleph::open_gap (Tarray &ptr, size_t n, size_t pos=0, size_t num_entries=1) |
| Open a gap in an array by shifting elements right. | |
| template<typename T > | |
| void | Aleph::close_gap (T *ptr, size_t n, size_t pos, size_t num_entries=1) |
| Close a gap in an array by shifting elements left. | |
| template<typename T > | |
| void | Aleph::reverse (T *ptr, const size_t n) noexcept |
| Reverse an array in-place. | |
| template<typename T > | |
| void | Aleph::rotate_left (T *ptr, const size_t n, size_t m) noexcept |
| Rotate array elements left by m positions. | |
| template<typename T > | |
| void | Aleph::rotate_right (T *ptr, const size_t n, size_t m) noexcept |
| Rotate array elements right by m positions. | |
Utility functions for array manipulation.
This file provides efficient algorithms for manipulating contiguous arrays including gap operations and rotations.
| Function | Description | Complexity |
|---|---|---|
| open_gap | Insert space at position | O(n) |
| close_gap | Remove elements at position | O(n) |
| reverse | Reverse array in-place | O(n) |
| rotate_left | Rotate elements left | O(n) |
| rotate_right | Rotate elements right | O(n) |
Definition in file array_utils.H.