fizzbuzz/stack
AJ ONeal 41fb3a2c92 made it easier to change the stack test size, added linked-list implementation by Eric 2011-08-17 16:10:36 +00:00
..
include implement a stack in c 2011-08-15 12:54:11 -06:00
.gitignore implement a stack in c 2011-08-15 12:54:11 -06:00
CMakeLists.txt implement a stack in c 2011-08-15 12:54:11 -06:00
Makefile made it easier to change the stack test size, added linked-list implementation by Eric 2011-08-17 16:10:36 +00:00
README.md fixed queue -> stack 2011-08-16 09:33:43 -06:00
stack-test.c made it easier to change the stack test size, added linked-list implementation by Eric 2011-08-17 16:10:36 +00:00
stack.c implement a stack in c 2011-08-15 12:54:11 -06:00
stack.reference.eric.c made it easier to change the stack test size, added linked-list implementation by Eric 2011-08-17 16:10:36 +00:00

README.md

Stack (vanilla C)

Implement stack.c with the following methods (as defined in include/stack.h)

  • create
  • push
  • pop
  • peek
  • length
  • destroy

The underlying implementation may be

  • dynamically-sized array
  • linked-list
  • any other ordered data structure

The storage strategy may

  • make copies of the original elements
  • store pointers to the original elements

The implementation must pass the following test suite stack-test.c

tar xf stack.tar.gz -C ~/
cd ~/stack
mkdir -p build
cd build
cmake ../
make
./stack-test

Prep

rm -rf stack/stack.c
touch stack/stack.c
tar czf stack.tar.gz stack/