The better practice is to design your data structure and algorithms on the paper before you start to write code, otherwise your code will be messier and messier when you write it and it will also be less portable.
- Deletion in contiguous list
- Insertion in contiguous list
- Josephus problem (linked list)
- Classify commodities (linked list)
hw1-1, hw1-2 use contiguous list and hw1-3, hw1-4 use linked list. The generic implementation of linked list is in LinkedList.c
, LinkedList.h
.
However, due to the restrictions of the procedure-oriented nature of C, implementing a generic linked list that suits all kinds of data is next to impossible. Therefore, there are linked lists implemented inside those two solutions, respectively. And the "generic" version is just for learning purpose.
- Bracket matching (stack)
- Pascal's triangle (queue)
- Train coach rearrangement (queue)
- Knuth-Morris-Pratt algorithm for pattern searching
- Traverse thru binary tree
- Huffman coding
- Balanced binary search tree
- Max heap
- Traverse thru graph
- Shortest paths
- Minimum spanning tree
- Shellsort
- 2-way mergesort
- Quicksort
- Radix sort
This part is especially extremely annoying. On the one hand, you have to record the state of each "round", however, those recursive algorithms don't work that way. On the other hand, you can't use any of the variants but only to reproduce a given implementation. Not to mention you spend more time reinventing the wheel than developing the algorithm.
The course offered 13 projects out of which it requires each student to choose 5 (at least 2 with an asterisk).
- Knapsack problem
- Wolf, goat and cabbage problem
- Design a simple spreadsheet
- Eight queens problem
- Josephus problem
- Lesson planning (*)
- Binary search tree and balanced binary tree (*)
- Parking lot challenge
- Score analysis
- Unary sparse polynomial calculator
- Huffman coding (*)
- Traffic consulting system (*)
- Maze experiment (*)