Algorithms-1 — Course Assignments & Lab Tests
Project Overview:
- Purpose: Collection of C solutions for Algorithms course assignments and lab tests.
- Language: Primarily C source files (.c).
- Structure: Each assignment (A0..A7) and lab test has its own folder containing problem files.
Directory Structure
A0 - PDS-Brushup/: brush-up problems and small practice exercises.A1 - Algorithm-Runtimes/: runtime/complexity problems and implementations.A2 - Recursion-DnC/: recursion and divide-and-conquer problems.A3 - Greedy-Algorithms/: greedy algorithm problems.A4 - Dynamic-Programming/: dynamic programming problems.A5 - Binary-Trees/: binary tree related exercises.A6 - Heap-Implementation/: heap data structure implementation.A7 - Graph-Algorithms/: graph algorithms and related problems.Lab-Test-1/: lab test 1 solutions.Lab-Test-2/: lab test 2 solutions.Slides/: course slides and supporting materials.
Files by Folder (present in repository)
A0 - PDS-Brushup/:
A0-Q1.cA0-Q2-v1.cA0-Q2-v2.cinput.txt
A1 - Algorithm-Runtimes/:
A1-Q1-P1.cA1-Q1-P2.cA1-Q2-P1.cA1-Q2-P2.c
A2 - Recursion-DnC/:
A3 - Greedy-Algorithms/:
A4 - Dynamic-Programming/:
A5 - Binary-Trees/:
A6 - Heap-Implementation/:
A7 - Graph-Algorithms/:
Lab-Test-1/:
Lab-Test-2/:
What you'll find in each assignment folder
- C source files: Implementations of the assigned problems. Filenames indicate assignment and question numbers.
- Multiple versions: Some problems include multiple solution versions (e.g.,
A0-Q2-v1.c andA0-Q2-v2.c) — these are alternative approaches or iterative attempts. - Input files: Where present (e.g.,
input.txt in A0), they provide sample input for testing.
How to compile and run (macOS / zsh)
Compile a single C file:
gcc -o <output_name> <source_file.c>
Example:
gcc -o A0-Q1 A0\ -\ PDS-Brushup/A0-Q1.c
Run an executable (optionally with redirected input):
./A0-Q1 < "A0 - PDS-Brushup/input.txt"
Compile all .c files in a folder:
gcc -std=c11 -O2 -Wall -Wextra -o program *.c