Little ditties. The usual suspects.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
AJ ONeal 41fb3a2c92 made it easier to change the stack test size, added linked-list implementation by Eric 13 years ago
..
include implement a stack in c 13 years ago
.gitignore implement a stack in c 13 years ago
CMakeLists.txt implement a stack in c 13 years ago
Makefile made it easier to change the stack test size, added linked-list implementation by Eric 13 years ago
README.md fixed queue -> stack 13 years ago
stack-test.c made it easier to change the stack test size, added linked-list implementation by Eric 13 years ago
stack.c implement a stack in c 13 years ago
stack.reference.eric.c made it easier to change the stack test size, added linked-list implementation by Eric 13 years ago

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/