mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
update documetnation
This commit is contained in:
parent
94a494edf5
commit
631b50cede
@ -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_
|
#ifndef DATA_STRUCTURES_STACK_H_
|
||||||
#define DATA_STRUCTURES_STACK_H_
|
#define DATA_STRUCTURES_STACK_H_
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
/* 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 <class Type>
|
template <class Type>
|
||||||
struct node {
|
struct node {
|
||||||
Type data;
|
Type data; ///< data at current node
|
||||||
node<Type> *next;
|
node<Type> *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 Type>
|
template <class Type>
|
||||||
class stack {
|
class stack {
|
||||||
public:
|
public:
|
||||||
@ -135,7 +144,7 @@ class stack {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
node<Type> *stackTop; /**< Pointer to the stack */
|
node<Type> *stackTop; /**< Pointer to the stack */
|
||||||
int size;
|
int size; ///< size of stack
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DATA_STRUCTURES_STACK_H_
|
#endif // DATA_STRUCTURES_STACK_H_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user