CST 370 - Design and Analysis of Algorithms - Week 7

 


This week in CST-370, I learned about non-comparison based sorting algorithms such as Counting Sort and Radix Sort. Unlike traditional sorting algorithms that rely on comparisons, Counting Sort uses frequency counting and distribution calculations to sort integers efficiently when the range of numbers is relatively small. The time complexity of Counting Sort is O(n + k), where n is the number of elements and k is the range of values. Additionally, I learned about Radix Sort, which processes numbers digit by digit, starting from the least significant digit (LSD) and applying Counting Sort iteratively. Radix Sort is particularly useful for sorting numbers with multiple digits, and its efficiency is O(d * (n + k)), where d represents the number of digits in the largest number. Counting Sort maintains the stability of elements, preserving their relative order in the output.

I also learned more Dynamic Programming (DP) and its applications in optimization problems. The concept of overlapping subproblems and optimal substructure makes DP an effective technique for solving problems like the Fibonacci sequence, the Coin-Collecting Problem, and the Coin-Row Problem. Instead of recomputing the same values recursively, DP uses memoization or iterative tabulation to store intermediate results, significantly reducing redundant calculations. Another important topic covered was Floyd’s Algorithm, which finds the shortest paths between all pairs of vertices in a weighted graph. The algorithm progressively updates the distance matrix by considering each vertex as an intermediate step. Lastly, I was introduced to Greedy algorithms and their applications, such as Prim’s Algorithm for Minimum Spanning Trees (MSTs). The Greedy approach makes locally optimal choices at each step, which sometimes leads to globally optimal solutions.

Comments

Popular posts from this blog

CST 334 - Operating Systems - Week 6

CST 363 - Introduction to Database - Week 3

CST 311 - Intro to Computer Networks - Week 1