Skip to content

Commit f0466dc

Browse files
ClémentClément
authored andcommitted
Adding notes about stack implementation.
1 parent 7dbe050 commit f0466dc

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

source/lectures/data/stack.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,19 @@ However, the `Stack` class is also different from lists:
4545

4646
## Possible Implementation
4747

48-
Here is a possible implementation of stacks:
48+
### Using Cells
49+
50+
Here is a possible implementation of stacks, using cells:
4951

5052
```{download="./code/projects/CStack.zip"}
5153
!include code/projects/CStack/CStack/CStack.cs
5254
```
55+
56+
57+
### Using Arrays
58+
59+
Another implementation, using arrays, requires the stack to have a fixed size:
60+
61+
```{download="./code/projects/CAStack.zip"}
62+
!include code/projects/CAStack/CAStack/CAStack.cs
63+
```

0 commit comments

Comments
 (0)