mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
Add syntax highlight
This commit is contained in:
parent
90e6ee0771
commit
88de94d1b4
@ -13,25 +13,35 @@ You need to only import the **stack.h**
|
|||||||
|
|
||||||
### Public interface
|
### Public interface
|
||||||
|
|
||||||
``` void initStack(); ```
|
```c
|
||||||
|
void initStack();
|
||||||
|
```
|
||||||
|
|
||||||
Initializes the stack with a capacity of 10 elements.
|
Initializes the stack with a capacity of 10 elements.
|
||||||
|
|
||||||
``` void push(void * object); ```
|
```c
|
||||||
|
void push(void * object);
|
||||||
|
```
|
||||||
|
|
||||||
pushs the argument onto the stack
|
pushs the argument onto the stack
|
||||||
|
|
||||||
``` void * pop(); ```
|
```c
|
||||||
|
void * pop();
|
||||||
|
```
|
||||||
|
|
||||||
pop: pops the top element of the stack from the stack.
|
pop: pops the top element of the stack from the stack.
|
||||||
|
|
||||||
assumes: stack not empty.
|
assumes: stack not empty.
|
||||||
|
|
||||||
``` int size(); ```
|
```c
|
||||||
|
int size();
|
||||||
|
```
|
||||||
|
|
||||||
gets the number of elements of the stack.
|
gets the number of elements of the stack.
|
||||||
|
|
||||||
``` int isEmpty(); ```
|
```c
|
||||||
|
int isEmpty();
|
||||||
|
```
|
||||||
|
|
||||||
returns 1 if stack is empty otherwise 0.
|
returns 1 if stack is empty otherwise 0.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user