Files:
- CS362 HW1.pdf– Assignment
- Youssef_Amin_HW1.pdf– Written solutions and explanations
- hw1.py– Python code implementing selected solutions
Topics covered:
- Minimum-cost flow formulation using linear programming
- Vendor optimization problem via constraint modeling
- Local minima search using a binary-search variant
- Shortest-path algorithms (Bellman–Ford, Dijkstra, Floyd–Warshall)
- Tree detection using DFS and adjacency lists
- Network-flow modeling for constrained assignment problems
Files:
- Module_2__Advanced_Divide_and_Conquer.pdf– Assignment
- Youssef_Amin_HW2.pdf– Full written solutions and explanations
- hw2.py– Python implementations of all major problems
Topics covered:
- Implementing a Stack with a BST – simulating LIFO behavior using an order-tracked Binary Search Tree
- Combining Heaps – merging two min-heaps in linear time using bottom-up heapify
- Merging Binary Search Trees – creating a unified in-order traversal in O(m + n) time
- Linear-Time Selection with Groups of Six – proving Θ(n) complexity via recurrence expansion
- Longest Increasing Subsequence – dynamic-programming reconstruction using predecessor tracking
- Sorting by Permutation – constant-space in-place array reordering in O(n) time
- Double Knapsack Problem – 3-D dynamic-programming approach for optimal dual-capacity allocation
- Contained Interval Detection – sorting by start and negative endpoints to find nested intervals in O(n log n)
Language: Python 3
Libraries: None required beyond the standard library
Youssef Amin
University of New Mexico
CS 362 – Fall 2025