Skip to content

Commit

Permalink
docs(data_structures/avltree_map.[cpp,hpp]): add missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RIvance committed Apr 15, 2023
1 parent 554d5cb commit 6fe9d2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data_structures/avltree_map.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file avltree_map.cpp
* @file
* @brief Unit testings for `AvlTreeMap<K, V>`
* @details This file contains the unit testings for `AvlTreeMap<K, V>`
* including insertions, deletions and queries. These tests cover all
Expand Down
12 changes: 11 additions & 1 deletion data_structures/avltree_map.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file avltree_map.hpp
* @file
* @brief An [AVLTree](https://en.wikipedia.org/wiki/AVL_tree)-based
* map implementation
* @details The map is sorted according to the natural ordering of its
Expand Down Expand Up @@ -63,6 +63,12 @@ class AvlTreeMap

private:

/**
* @brief The node type
* @details A node is a basic unit of the AVLTree, which
* contains the key, value, balance factor, height and
* pointers to its children.
*/
struct Node
{
using Ptr = std::shared_ptr<Node>; ///< node pointer type
Expand Down Expand Up @@ -110,6 +116,10 @@ class AvlTreeMap
return node;
}

/**
* @brief Whether this node is a leaf
* @return bool true if this node is a leaf, false otherwise
*/
inline bool isLeaf() const noexcept
{
return this->left == nullptr && this->right == nullptr;
Expand Down

0 comments on commit 6fe9d2c

Please sign in to comment.