diff --git a/data_structures/stack.h b/data_structures/stack.h index 31a5abe34..429e0265f 100644 --- a/data_structures/stack.h +++ b/data_structures/stack.h @@ -1,18 +1,27 @@ -/* This class specifies the basic operation on a stack as a linked list */ +/** + * @file stack.h + * @author danghai + * @brief This class specifies the basic operation on a stack as a linked list + **/ #ifndef DATA_STRUCTURES_STACK_H_ #define DATA_STRUCTURES_STACK_H_ #include #include -/* Definition of the node */ +/** Definition of the node as a linked-list + * \tparam Type type of data nodes of the linked list should contain + */ template struct node { - Type data; - node *next; + Type data; ///< data at current node + node *next; ///< pointer to the next ::node instance }; -/* Definition of the stack class */ +/** Definition of the stack class + * \tparam Type type of data nodes of the linked list in the stack should + * contain + */ template class stack { public: @@ -135,7 +144,7 @@ class stack { private: node *stackTop; /**< Pointer to the stack */ - int size; + int size; ///< size of stack }; #endif // DATA_STRUCTURES_STACK_H_