Study resources

Learning plan and laboratories

Course route

This book follows the four sections of the supplied CSE-201F Data Structures Using C syllabus. Read the conceptual lesson, reproduce the worked trace, run the relevant program and then attempt the practice questions without the answers.

Section Chapters Main outcomes
A 1–6 C foundations, algorithm analysis, arrays, searching, sorting, stacks and queues
B 7–9 Pointers, memory ownership, linked lists, linked stacks and queues
C 10–12 Binary trees, threaded trees, B-trees, graph representation and traversal
D 13–14 File handling, AVL trees, sets and skip lists
Enrichment Appendices A–B Hashing and a separate C++ comparison

The core language is C11. Knowledge of variables, expressions and basic control flow is helpful; Chapter 1 provides a focused refresher rather than a complete first course in programming.

Suggested study sequence

  1. Foundations: Chapters 1–2. Write contracts and count operations before coding.
  2. Contiguous storage: Chapters 3–5. Draw indices, trace every shift and compare search preconditions.
  3. Linear ADTs: Chapter 6. Test underflow, overflow and circular wraparound.
  4. Dynamic storage: Chapters 7–9. Draw links before each pointer assignment and account for every allocation.
  5. Nonlinear structures: Chapters 10–12. Distinguish traversal order, search order and graph reachability.
  6. Persistence and balance: Chapters 13–14. Check I/O results and reason from structural invariants.

Run the laboratories

The examples are independent programs with their own main functions. Do not combine all C files into one executable. From the ebook folder, compile one:

cc -std=c11 -Wall -Wextra -Werror -pedantic code/arrays_search.c -o /tmp/arrays_search
/tmp/arrays_search

A C11 compiler is required; reading the ebook needs only a browser. The programs use assertions as part of their test harness. Do not compile these demonstrations with -DNDEBUG, because that removes assertions and some test operations.

Lab Read with Focus
arrays_search.c 3–4 Logical length, capacity and search boundaries
sorting.c 5 All six syllabus sorting methods
stack_queue.c 6 Full/empty handling and ring wraparound
linked_list.c 7–8 Ownership, search, removal and cleanup
linked_stack_queue.c 9 Constant-time endpoint operations
bst.c 10 BST insertion, search and traversals
graph_traversal.c 12 Matrix-based BFS and DFS
file_records.c 13 Checked temporary-file round trip
avl.c 14 Insertion rotations and invariant checks
hashing.c Appendix A Linear probing and tombstones

Run the supplied suite with sh tests/run_c_examples.sh. The suite compares each program's exact output with its expected output. Sanitizer support is compiler- and environment-dependent; details are in the laboratory README. Successful tests support the demonstrated cases, not all possible inputs or production readiness.

Mini projects

Student record collection

Use a linked list to add and remove records, export an array for sorting by roll number, and write a clearly specified text format. Acceptance checks: duplicate policy stated; missing deletion leaves data unchanged; malformed file records rejected; all allocated nodes released.

Queue-based service simulator

Use a circular queue for a bounded waiting line. Record arrivals and removals. Acceptance checks: FIFO order survives wraparound; full arrivals fail predictably; empty removal does not invent a request; capacity and logical size remain distinct.

Graph route explorer

Read a small graph, print BFS and DFS orders and use BFS predecessors to reconstruct an unweighted route. Acceptance checks: cycles do not cause repeated visits; disconnected targets are reported; neighbour order is documented; invalid vertex indices are rejected.

Revision checklist

For every structure, answer five questions: What is the invariant? Which operations are supported? What are their preconditions? What happens on failure? What costs depend on representation or input shape?

Use the separate answer section after making a written attempt. A correct algorithm explanation should include a trace, a reason it terminates and a justified complexity bound—not only a code listing.