자료구조 과제 #1
C Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Makefile
README.md
list.c
list.h
main.c
primative.c
primative.h
run_test.py
stack.c
stack.h
test.c
test.dat

README.md

DataStructure HW #1

아주대학교 2012 CS 자료구조 수업 과제 #1에 대한 구현입니다. String과 Sub-list를 포함하는 List에 대해 append, reverse, flatten 연산을 할 수 있는 interpreter를 만드는 과제입니다.

문제의 자세한 요구사항은 gist에서 볼수 있습니다.

이 과제 샘플데이터에 대한 테스트 스크립트를 실행하시려면:

$ make
$ python run_test.py
Run test 1
Input: reverse append (cat) | (mew)
Output should be: (mew cat)
Output: (["mew", "cat"])

Run test 2
Input: append reverse (cat mew) | (dog)
Output should be: (mew cat dog)
Output: (["mew", "cat", "dog"])

Run test 3
Input: append (cat) | reverse (mew dog)
Output should be: (cat dog mew)
Output: (["cat", "dog", "mew"])

Run test 4
Input: flatten append (cat) | ((mew) (dog))
Output should be: (cat mew dog)
Output: (["cat", "mew", "dog"])

Run test 5
Input: append (cat) | reverse ((mew) (dog))
Output should be: (cat (dog) (mew))
Output: (["cat", ["dog"], ["mew"]])

Run test 6
Input: flatten append (cat) | reverse ((mew) (dog))
Output should be: (cat dog mew)
Output: (["cat", "dog", "mew"])

Run test 7
Input: append reverse (cat mew) | ((dog) (pig) (racoon))
Output should be: (mew cat (dog) (pig) (racoon))
Output: (["mew", "cat", ["dog"], ["pig"], ["racoon"]])

Run test 8
Input: append reverse (cat mew) | flatten ((dog) (pig) (racoon))
Output should be: (mew cat dog pig racoon)
Output: (["mew", "cat", "dog", "pig", "racoon"])