Assignments

DATE

ASSIGNMENT

SOLUTION

HW
Wed, Jun 24
EX 1
Thu, Jun 25
  • Write a small C program from scratch with multiple functions.
  • Parse command-line arguments and convert C-strings to numbers.
  • Read C library documentation and use the linter and valgrind to clean up your code.
EX 2
Thu, Jul 02
  • Write code that uses pointers and data representations.
  • Examine the relationship between pointers and arrays.
  • Use format specifiers to handle printing fixed-width integers.
EX 3
Wed, Jul 08
  • Define and use structs with typedef.
  • Use malloc and free to manage dynamically-allocated data without memory leaks.
  • Write some basic automated tests in C.
  • Modularize a C program across multiple files.
HW 1
Thu, Jul 09
  • Implement a doubly-linked list in C.
  • Implement a chained hash table in C.
  • Practice manual memory management with malloc and free.
  • Debug pointer-heavy code with gdb and valgrind.
EX 4
Fri, Jul 17
  • Read a file's size and contents using only POSIX I/O (open/read/lseek/close).
  • Handle short reads and errors from read(), cleaning up resources on every path.
  • Implement a directory iterator module using the POSIX dirent API.
  • Measure how read granularity affects file I/O performance.
  • Call C modules from a C++ client.
HW 2
Thu, Jul 23
  • Read a file into memory and parse its text into words with byte-offset positions.
  • Recursively crawl a directory tree and index the text files it contains.
  • Build an in-memory inverted index that maps words to per-document posting lists.
  • Implement a console search shell that ranks and returns documents matching a query.
  • Reuse and compose the HW1 LinkedList and HashTable modules while managing memory with malloc/free.