Skip to content

Commit c1c2808

Browse files
authored
Update Stack.md
1 parent c2dc57a commit c1c2808

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Stack.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,25 @@ void isFull()
119119
}
120120
}
121121
```
122+
123+
### Display
124+
Displays all the elements if array starting from the last element added to first.
125+
126+
```c
127+
void Display()
128+
{
129+
if (Top == -1)
130+
{
131+
printf("\nStack Underflow");
132+
}
133+
else
134+
{
135+
int i;
136+
printf("\nElements of array array: ");
137+
for(i = Top; i >= 0; --i)
138+
{
139+
printf("%d ",array[i]);
140+
}
141+
}
142+
}
143+
```

0 commit comments

Comments
 (0)