Skip to content

Latest commit

 

History

History
87 lines (66 loc) · 2.41 KB

File metadata and controls

87 lines (66 loc) · 2.41 KB

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.c
    • A0-Q2-v1.c
    • A0-Q2-v2.c
    • input.txt
  • A1 - Algorithm-Runtimes/:

    • A1-Q1-P1.c
    • A1-Q1-P2.c
    • A1-Q2-P1.c
    • A1-Q2-P2.c
  • A2 - Recursion-DnC/:

    • A2-Q1.c
    • A2-Q2.c
  • A3 - Greedy-Algorithms/:

    • A3-Q1.c
    • A3-Q2.c
  • A4 - Dynamic-Programming/:

    • A4-Q1.c
    • A4-Q2.c
  • A5 - Binary-Trees/:

    • A5-Q1.c
    • A5-Q2.c
  • A6 - Heap-Implementation/:

    • A6-Q1.c
  • A7 - Graph-Algorithms/:

    • A7-Q1.c
    • A7-Q2.c
  • Lab-Test-1/:

    • LT1-Q1.c
    • LT1-Q2.c
    • LT1-Q3.c
  • Lab-Test-2/:

    • LT2-Q1.c
    • LT2-Q2.c
    • LT2-Q3.c

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 and A0-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