Posts

Showing posts from October, 2025

Dynamic Programming

This week, I explored how Counting Sort and Radix Sort work without direct comparisons by grouping or distributing elements based on digit values. These methods helped me understand how certain sorts can achieve linear time when the range of data is limited. We also practiced dynamic programming. Dynamic Programming (DP) solves problems by breaking them into smaller overlapping problems. In the coin-row and coin-collecting examples, I used recurrence relations to build solutions to maximize path rewards. These exercises show how efficient DP is because it stores previous results to avoid redundant work.  We also covered graph algorithms like Warshall’s, Floyd’s, and Prim’s. Warshall’s and Floyd’s algorithms rely on updating matrices to determine connectivity and shortest paths. Prim’s algorithm builds a minimum spanning tree by adding the smallest edges step by step. This module strengthened my understanding of dynamic programming and graph algorithms. These prove to be useful tool...

Efficiency Through the Balance of Trees

This week’s material focused on data structures like AVL trees, heaps, and hash tables. It reinforced my understanding of self-balancing binary search trees and their properties. I learned how an AVL tree maintains balance by ensuring the height difference between left and right subtrees never exceeds one. The material introduced 2-3 trees and heaps and helped me visualize how structural properties influence data organization and retrieval speed.  In the lab, I implemented heap operations such as building a max heap, inserting new elements, deleting the maximum value, and verifying if a given array satisfies the heap property. The assignment showed how a binary heap can efficiently support priority-based operations. In another part of the lab, I developed a hash table using linear probing with rehashing. It showed how functions can distribute data across an array and how collisions are resolved through probing. 

More Key Concepts - Sorting and Graphs

This week, I strengthened my understanding of more key algorithmic concepts. In the programming assignments, I was tasked to write two different approaches to partition an array so that all negative numbers appear before the positive ones. The first used a two-pointer method that swapped elements from both ends. The second used a single-pass scanning approach to shift negatives forward. I also got the opportunity to implemented Kahn’s Algorithm for topological sorting. This required building an adjacency list, calculating indegrees, and using a priority queue to process vertices in ascending order.   The material this week covered topics like Quicksort partitioning, Binary Search Trees, and graph traversal algorithms. I was tasked to practice identifying the results of the first partitioning step in Quicksort and analyzing time complexities for finding the minimum key in a BST. The quiz also tested understanding of DAGs and topological sorting, including how to determine indeg...