β οΈ IMPORTANT NOTICE
This is an alternative, non-formal learning kit designed to supplement and extend the official "Programming Techniques and Algorithms" curriculum. It is not an official course material and should be used for self-study, practice, and deeper exploration of data structures and algorithms concepts.
This comprehensive laboratory kit provides 14 weeks of structured learning materials covering fundamental data structures and algorithmic concepts. Each weekly module includes theoretical foundations, hands-on exercises, automated testing frameworks, and professional-grade HTML presentations designed for offline use.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β’ First-year Computer Science students β
β β’ Self-learners preparing for technical interviews β
β β’ Educators seeking supplementary teaching materials β
β β’ Professionals refreshing algorithmic foundations β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Each of the 14 weekly modules follows a consistent, pedagogically-sound structure:
week-NN-topic/
βββ README.md # Comprehensive documentation (8-25KB each)
βββ Makefile # Build automation with testing & Valgrind
β
βββ slides/
β βββ presentation-weekNN.html # Main lecture (1500-2100 lines, ~40 slides)
β βββ presentation-comparativ.html # C vs Python side-by-side comparison
β
βββ src/
β βββ example1.c # Complete working demonstration
β βββ exercise1.c # Guided exercise (TODOs)
β βββ exercise2.c # Advanced exercise
β
βββ data/
β βββ *.txt # Sample data files for testing
β
βββ tests/
β βββ test1_input.txt # Automated test inputs
β βββ test1_expected.txt # Expected outputs
β βββ test2_input.txt
β βββ test2_expected.txt
β
βββ teme/
β βββ homework-requirements.md # Two graded assignments (50pts each)
β βββ homework-extended.md # 5 bonus challenges
β
βββ solution/
βββ exercise1_sol.c # Exercise solutions
βββ exercise2_sol.c
βββ homework1_sol.c # Homework solutions
βββ homework2_sol.c
| Metric | Count |
|---|---|
| Weekly Modules | 14 |
| C Source Files | 99 |
| Lines of C Code | ~49,000 |
| Markdown Documentation | 42 files |
| README Documentation Lines | ~6,500 |
| HTML Presentations | 28 |
| Presentation Lines (total) | ~50,000 |
| Test Cases | 56 |
| Homework Assignments | 28 |
βββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β WEEK β TOPIC β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 01 β Pointers to Functions and Callbacks in C β
β β ββ Function pointer syntax, qsort(), bsearch(), dispatch tables β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 02 β Text File Processing in C β
β β ββ File I/O, buffering, parsing, error handling β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 03 β Binary Files in C β
β β ββ fread/fwrite, struct serialization, endianness β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 04 β Linked Lists β
β β ββ Singly/doubly linked, circular lists, operations β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 05 β Stacks β The LIFO Data Structure β
β β ββ Array/linked implementations, expression evaluation β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 06 β Queues β
β β ββ Circular queues, deques, priority queues introduction β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 07 β Binary Trees β
β β ββ Tree terminology, traversals (pre/in/post), recursion β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 08 β Binary Search Trees (BST) β
β β ββ BST property, search/insert/delete, complexity analysis β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 09 β AVL Trees β
β β ββ Balance factors, rotations (LL/RR/LR/RL), rebalancing β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 10 β Heaps and Priority Queues β
β β ββ Heap property, heapify, heap sort, priority queue ADT β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 11 β Hash Tables β
β β ββ Hash functions, collision resolution, load factor β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 12 β Graph Fundamentals β
β β ββ Representations, BFS, DFS, applications β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 13 β Graph Algorithms β Shortest Path β
β β ββ Dijkstra, Bellman-Ford, weighted graphs β
βββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 14 β Advanced Topics and Comprehensive Review β
β β ββ Algorithm comparison, complexity summary, exam preparation β
βββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββ
β FOUNDATIONAL CONCEPTS β
β Week 01: Function Pointers β
β Week 02-03: File Processing β
ββββββββββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββββββ
β LINEAR DATA STRUCTURES β
β Week 04: Linked Lists β
β Week 05: Stacks β
β Week 06: Queues β
ββββββββββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
β HIERARCHICAL STRUCTURES β β ASSOCIATIVE DATA β
β Week 07: Binary Trees β β Week 11: Hash Tables β
β Week 08: BST β ββββββββββββββββ¬βββββββββββββββ
β Week 09: AVL Trees β β
β Week 10: Heaps β β
βββββββββββββ¬ββββββββββββββββ β
β β
βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββββββββββββββββ
β GRAPH ALGORITHMS β
β Week 12: Graph Fundamentals β
β Week 13: Shortest Path β
ββββββββββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββββββ
β SYNTHESIS AND REVIEW β
β Week 14: Comprehensive Review β
βββββββββββββββββββββββββββββββββββββββββββ
Cognitive Level: Foundational β Applied
| Component | Description | Quality Assessment |
|---|---|---|
| Theory | Function pointer syntax, callback pattern, qsort/bsearch contracts | β β β β β Comprehensive |
| Example | Calculator with dispatch tables, student sorting system | β β β β β Production-quality |
| Exercises | Dispatch table implementation, multi-field sorting | β β β β β Appropriate difficulty |
| Homework | Generic search engine, event dispatcher | β β β β β Industry-relevant |
Key Concepts Covered:
int (*fptr)(int, int)syntax and semantics- Type-safe comparator patterns (avoiding overflow)
- Dispatch tables as alternative to switch statements
- Industrial applications: GTK, Win32, libuv
Cognitive Level: Remember β Analyze
| Component | Description | Quality Assessment |
|---|---|---|
| Theory | Buffered I/O, stdio.h internals, parsing strategies | β β β β β Excellent depth |
| Example | CSV parser with error recovery | β β β β β Robust implementation |
| Exercises | Log file analysis, configuration parser | β β β β β Real-world scenarios |
| Homework | Web log analyser, INI file manager | β β β β β Professional requirements |
Industrial Relevance:
// Example: Safe file reading pattern demonstrated
while (fgets(buffer, sizeof(buffer), fp) != NULL) {
if (buffer[strlen(buffer)-1] != '\n' && !feof(fp)) {
// Handle line too long
}
}Cognitive Level: Understand β Create
| Component | Description | Quality Assessment |
|---|---|---|
| Theory | Binary vs text, endianness, struct padding | β β β β β Thorough |
| Example | Student database with binary storage | β β β β β Good foundation |
| Exercises | Inventory system, record management | β β β β β Appropriate |
| Homework | Database with indices, file merger | β β β β β Complex |
Cognitive Progression: Linked Lists β Stacks β Queues
Complexity Analysis Summary:
ββββββββββββββββββ¬βββββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββββ
β Operation β Array β Linked β Stack β Queue β
ββββββββββββββββββΌβββββββββββΌβββββββββββΌβββββββββββΌββββββββββββ€
β Access [i] β O(1) β O(n) β N/A β N/A β
β Insert front β O(n) β O(1) β N/A β O(1)* β
β Insert back β O(1)* β O(1)β β O(1) β O(1) β
β Delete front β O(n) β O(1) β N/A β O(1) β
β Delete back β O(1) β O(n)β‘ β O(1) β N/A β
β Search β O(n) β O(n) β O(n) β O(n) β
ββββββββββββββββββ΄βββββββββββ΄βββββββββββ΄βββββββββββ΄ββββββββββββ
* amortized β with tail pointer β‘ without tail
Tree Structure Evolution:
Week 07: Binary Tree Week 08: BST Week 09: AVL
A 50 50
/ \ / \ / \
B C 30 70 30 70
/ \ \ / \ / \ / \ / \
D E F 20 40 60 80 20 40 60 80
BF=0 for all nodes
Week 10: Heap (Max)
100
/ \
90 80
/ \ / \
70 60 50 40
| Week | Focus | Key Algorithms | Complexity |
|---|---|---|---|
| 07 | Traversals | Pre/In/Post-order, Level-order | O(n) |
| 08 | BST Operations | Search, Insert, Delete | O(h) β O(log n) avg |
| 09 | Self-balancing | 4 rotation types, height maintenance | O(log n) guaranteed |
| 10 | Heap Operations | Heapify, Extract-Max, Heap-Sort | O(log n), O(n log n) |
Collision Resolution Strategies Covered:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. Chaining (Separate Chaining) β
β βββββ βββββ¬ββββ β
β 0 β βββΌβββββΊβ A β βββΌββββΊ NULL β
β βββββ€ βββββ΄ββββ β
β 1 βNILβ β
β βββββ€ βββββ¬ββββ βββββ¬ββββ β
β 2 β βββΌβββββΊβ B β βββΌβββββΊβ C β βββΌββββΊ NULL β
β βββββ βββββ΄ββββ βββββ΄ββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 2. Open Addressing (Linear/Quadratic Probing, Double Hashing) β
β βββββ¬ββββ¬ββββ¬ββββ¬ββββ¬ββββ¬ββββ¬ββββ β
β β A β β B β C β β β D β β β
β βββββ΄ββββ΄ββββ΄ββββ΄ββββ΄ββββ΄ββββ΄ββββ β
β β β β
β h(A)=0 h(B)=2, h(C)=2β3 (probe) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Representations Covered:
Adjacency Matrix Adjacency List
0 1 2 3 4 0: β 1 β 2
βββββββββββββββ 1: β 0 β 3
0 β 0 1 1 0 0 β 2: β 0 β 3 β 4
1 β 1 0 0 1 0 β 3: β 1 β 2 β 4
2 β 1 0 0 1 1 β 4: β 2 β 3
3 β 0 1 1 0 1 β
4 β 0 0 1 1 0 β Space: O(V + E)
βββββββββββββββ
Space: O(VΒ²)
Algorithms Implemented:
| Algorithm | Purpose | Time | Space |
|---|---|---|---|
| BFS | Shortest path (unweighted) | O(V+E) | O(V) |
| DFS | Connectivity, cycles | O(V+E) | O(V) |
| Dijkstra | Single-source shortest path | O(E log V) | O(V) |
| Bellman-Ford | Negative weights allowed | O(VE) | O(V) |
This kit was designed as an alternative curriculum focusing on data structures. The following table shows the alignment with the official "Programming Techniques and Algorithms" syllabus:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OFFICIAL SYLLABUS vs KIT COVERAGE β
ββββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββ¬βββββββββββββββββ€
β Official Topic β Kit Coverage β Status β
ββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββ€
β External file organization β Weeks 02-03 β β
COVERED β
β Text files β Week 02 β β
COVERED β
β Sequential binary files β Week 03 β β
COVERED β
β Relative binary files β Week 03 (partial) β β οΈ PARTIAL β
β Indexed binary files β Not covered β β MISSING β
ββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββ€
β Algorithm complexity β Week 08 (BST) β β οΈ EMBEDDED β
β Divide et Impera method β Not explicit β β MISSING β
ββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββ€
β Sorting algorithms (QuickSort, Shell, β Week 10 (HeapSort)β β οΈ PARTIAL β
β Counting, Radix, Bucket) β β β
ββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββ€
β Greedy method β Dijkstra/Prim β β οΈ IMPLICIT β
β Backtracking method β Not covered β β MISSING β
ββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββΌβββββββββββββββββ€
β Graphs: definitions, representations β Week 12 β β
COVERED β
β Graph traversals (BFS/DFS) β Week 12 β β
COVERED β
β Connectivity, paths β Week 12-13 β β
COVERED β
β Cut nodes, topological sorting β Not covered β β MISSING β
β Weighted graphs, shortest paths β Week 13 β β
COVERED β
β Minimum Spanning Trees (Kruskal, Prim) β Not covered β β MISSING β
ββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββ΄βββββββββββββββββ
These topics provide valuable foundational knowledge, typically covered in a dedicated "Data Structures" course:
| Topic | Week | Value Proposition |
|---|---|---|
| Linked Lists | 04 | Foundation for tree/graph implementations |
| Stacks | 05 | Expression evaluation, recursion simulation |
| Queues | 06 | BFS implementation, buffering |
| Binary Trees | 07 | Prerequisite for BST/AVL |
| BST | 08 | Efficient dynamic sets |
| AVL Trees | 09 | Guaranteed logarithmic operations |
| Heaps | 10 | Priority queues, heap sort |
| Hash Tables | 11 | O(1) average lookup |
To address gaps in both the official syllabus and advanced algorithm design, the following extensions are recommended:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Week 15: Algorithmic Paradigms β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β PART A: Divide and Conquer β
β βββ Theoretical framework: T(n) = aT(n/b) + f(n) β
β βββ Master Theorem application β
β βββ Examples: MergeSort, QuickSort, Binary Search β
β βββ Practical: Closest pair of points, Strassen's matrix multiplication β
β β
β PART B: Greedy Algorithms β
β βββ Greedy choice property and optimal substructure β
β βββ Activity selection problem β
β βββ Huffman coding β
β βββ Fractional knapsack β
β β
β PART C: Introduction to Dynamic Programming β
β βββ Overlapping subproblems and memoization β
β βββ Fibonacci: recursive β memoized β tabulated β
β βββ 0/1 Knapsack problem β
β βββ Longest Common Subsequence (LCS) β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Week 16: Advanced Graph Algorithms and Backtracking β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β PART A: Minimum Spanning Trees β
β βββ MST properties and cut property β
β βββ Kruskal's algorithm (Union-Find data structure) β
β βββ Prim's algorithm (priority queue implementation) β
β βββ Comparative analysis: when to use which β
β β
β PART B: Advanced Graph Topics β
β βββ Topological sorting (Kahn's algorithm, DFS-based) β
β βββ Strongly connected components (Kosaraju, Tarjan) β
β βββ Articulation points and bridges β
β βββ All-pairs shortest paths (Floyd-Warshall) β
β β
β PART C: Backtracking β
β βββ State-space tree and pruning β
β βββ N-Queens problem β
β βββ Sudoku solver β
β βββ Graph coloring β
β βββ Hamiltonian path β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Component | Requirement |
|---|---|
| Compiler | GCC 9.0+ with C11 support |
| OS | Linux (Ubuntu 20.04+), WSL2, macOS |
| Build System | GNU Make 4.0+ |
| Memory Checker | Valgrind 3.15+ |
| Browser | Modern browser for HTML slides |
All source files are compiled with strict warning flags:
CC = gcc
CFLAGS = -Wall -Wextra -std=c11 -g -O0
LDFLAGS = -lm# Clone or extract the kit
cd week-01-intro-pointers/
# View available commands
make help
# Compile all sources
make
# Run the demonstration
make run
# Run automated tests
make test
# Check for memory leaks
make valgrind
# Clean build artifacts
make clean| Aspect | Rating | Notes |
|---|---|---|
| Documentation | β β β β β | Comprehensive README files with historical context |
| Code Quality | β β β β β | Well-commented, follows best practices |
| Visual Design | β β β β β | Modern HTML presentations with offline capability |
| Testing | β β β β β | Automated tests with Valgrind integration |
| Pedagogy | β β β β β | Clear learning objectives, progressive difficulty |
| Practical Relevance | β β β β β | Industry-relevant homework assignments |
| Aspect | Current State | Recommendation |
|---|---|---|
| Syllabus Alignment | Data Structures focus | Add D&I, Greedy, Backtracking modules |
| Indexed Files | Not covered | Add Week 04.5 for indexed binary files |
| Sorting Algorithms | Only HeapSort | Add comprehensive sorting module |
| MST Algorithms | Missing | Include Kruskal and Prim |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Component β Points β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Laboratory Exercises (2 per week) β 20 points β
β βββ Exercise 1 β 10 points β
β βββ Exercise 2 β 10 points β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Homework Assignments (2 per week) β 80 points β
β βββ Homework 1 β 50 points β
β βββ Homework 2 β 50 points β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Extended Challenges (optional) β Bonus: +20 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Criterion | Weight | Description |
|---|---|---|
| Correctness | 40% | Passes all test cases |
| Code Quality | 20% | Readability, structure, documentation |
| Memory Safety | 20% | No leaks (Valgrind clean) |
| Error Handling | 10% | Graceful failure, informative messages |
| Efficiency | 10% | Appropriate algorithmic complexity |
| Resource | Type | URL |
|---|---|---|
| CLRS (Introduction to Algorithms) | Textbook | ISBN: 978-0262033848 |
| The Art of Computer Programming | Textbook | ISBN: 978-0201896831 |
| Visualgo | Visualisation | https://visualgo.net/ |
| cppreference.com | Documentation | https://en.cppreference.com/w/c |
| Compiler Explorer | Tool | https://godbolt.org/ |
| Platform | Description |
|---|---|
| LeetCode | Algorithm problems by topic |
| HackerRank | Data structures track |
| Codeforces | Competitive programming |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β RESTRICTIVE LICENSE NOTICE β
β β
β Β© 2025 All Rights Reserved β
β β
β This educational material is provided for PERSONAL STUDY ONLY. β
β β
β PROHIBITED without prior written consent: β
β β’ Publication in any form (print, digital, online) β
β β’ Use in formal educational settings (courses, workshops) β
β β’ Commercial use or redistribution β
β β’ Derivative works for teaching purposes β
β β
β For licensing inquiries, contact the author. β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
For questions, licensing requests, or feedback:
Author: Asistent (pe perioadΔ determinatΔ) ing. dr. Antonio Clim
Last updated: January 2025