- Documentation and logic fixes for various structures

This commit is contained in:
2025-12-17 12:40:10 -05:00
parent aee4e340dd
commit e7503ed92f
28 changed files with 1179 additions and 474 deletions

View File

@@ -385,8 +385,9 @@ public:
///
/// \brief Perform a Tree Rotation at `i` in the specified direction
/// \param i The root node for the rotation
/// \param sub The root node for the rotation
/// \param dir The direction to rotate, `true` for right, `false` for left
/// \returns the new root
constexpr size_t rotate(size_t sub, bool dir) {
if (sub == npos) {
return npos;
@@ -504,6 +505,8 @@ public:
}
}
///
/// \brief Traverser pattern for breadth-first traversal
struct breadth_first {
list<size_t> visit;
size_t head;
@@ -540,6 +543,8 @@ public:
}
};
///
/// \brief Traverser pattern for pre-order traversal
struct pre_order {
list<size_t> visit;
size_t head;
@@ -577,6 +582,8 @@ public:
}
};
///
/// \brief Traverser pattern for in-order traversal
struct in_order {
list<size_t> visit;
size_t head;
@@ -614,6 +621,8 @@ public:
}
};
///
/// \brief Traverser pattern for post-order traversal
struct post_order {
list<size_t> visit;
size_t head;