- Categories · Algorithms-

2021

Explore the fundamentals of Merge Sort, a stable and highly efficient divide-and-conquer sorting algorithm. This article provides a comprehensive overview, including pseudocode, in-depth algorithmic analysis with Master Theorem derivation, and fully corrected code implementations in Java and C. Learn why Merge Sort consistently delivers $O(n \log n)$ performance across all scenarios, though it requires $O(n)$ auxiliary space.

This article provides a comprehensive overview of the Quick Sort algorithm, a highly efficient comparison-based sorting method. It covers the core divide-and-conquer logic, analyzes its performance in best, worst, and average scenarios (ranging from $O(n \log n)$ to $O(n^2)$), and discusses critical optimization strategies like pivot selection methods (median-of-three, randomized). Complete with clear pseudocode and implementations in Java and C.

This article provides a comprehensive overview of Insertion Sort, a simple yet effective sorting algorithm. It details the algorithm's concept, analyzes its time and space complexity in best, worst, and average cases, and presents idiomatic implementations in both Java and C. Learn why Insertion Sort is adaptive and efficient for small or nearly sorted datasets.

2020

This article provides a comprehensive overview of Selection Sort, a simple comparison-based sorting algorithm. We explore its core steps - iterating to find the minimum element in the unsorted portion of a list and swapping it into its correct sorted position. The analysis details why Selection Sort is $O(n^2)$ time complexity for both average and worst cases due to nested loops, requiring minimal $O(1)$ extra space. We also explain why it is classified as an unstable sorting algorithm, demonstrated by a clear example where the relative order of equal elements is not preserved. A corrected Java implementation is included.

This guide covers essential searching algorithms—Linear and Binary Search. It details their logic, pseudocode, Java implementations, and complexities. Binary search's O(log n) efficiency on sorted collections is analyzed using the Master Theorem, and practical tips, including overcoming arithmetic errors and using built-in Java tools, are provided.

This post explores the application of numerical methods to analyze the initial growth trends of the COVID-19 outbreak using real-world data from Johns Hopkins CSSE. It utilizes a Quadratic Least Squares polynomial to model the time-series data of new confirmed cases, effectively smoothing inherent data noise. Subsequently, Richardson’s Extrapolation is applied to a 3-point midpoint formula to calculate the instantaneous rate of change (first derivative) of the new cases at various time intervals. The analysis reveals a significant deceleration in the growth rate over the studied period, suggesting the positive impact of early social distancing measures. The computational methods were implemented in MATLAB and Java, demonstrating robust modeling and high-precision results from low-order formulas.

2019

This article provides a comprehensive introduction to algorithm analysis, defining what algorithms are and distinguishing them from actual code implementations. It explores various algorithmic approaches, including deterministic, randomized, optimization, parallel, and distributed paradigms. Furthermore, it examines the critical resources consumed by algorithms—such as time, memory, power, bandwidth, circuitry, idleness, and load—and demonstrates how different data structure implementations (like array-based vs. linked lists) drastically affect performance for operations like insertion and retrieval.