Category: Data Structures & Algorithms

Join me to stay up-to-date and get my new articles delivered to your inbox by subscribing here.

System Design Interview – Web Crawler Service (Google Search) - January 26, 2023

A web crawler service, such as Google Search, is a system that automatically visits web pages and retrieves information from them. It is used to index web pages for search engines, monitor websites for changes, and create web archives. The web crawler service consists of several components: • Web Crawler: This is the main component […]

Read more

Random Graph & Tree Generator - November 13, 2022

Introduction This generator class provides methods for creating various graphs, including Erdos-Renyi random graphs, random bipartite graphs, random k-regular graphs, and random rooted trees. There is also a dependency on the Undirected Graphs class. Functions simple Returns a random simple graph containing V vertices and E edges. simple_erdos_renyi Returns a random simple graph on V […]

Read more

Undirected Graphs - November 12, 2022

An excerpt from the book Algorithms (4th Edition) by Robert Sedgewick and Kevin Wayne. And I also added a python implementation. Definitions Graph Representation Alternatives We have 2 basic requirements to choose the best graph representation (data structure) to use. Adjacency Matrix We maintain a V-by-V boolean array, with the entry in row v and […]

Read more

Longest Common Subsequence - November 1, 2022

Introduction Sequence comparison is a common problem in computer science and has applications in various fields such as DNA sequencing, text analysis, and version control. One powerful algorithm for solving this problem is the Longest Common Subsequence (LCS) algorithm, which finds the longest subsequence that two or more sequences have in common. In this tech […]

Read more

Merge Sort - November 1, 2022

Introduction Sorting is a common task in computer programming, and it involves arranging a collection of elements in a specific order. There are various sorting algorithms available, and one of the most efficient and widely used algorithms is Merge Sort. In this tech blog, we will explore Merge Sort, how it works, its advantages, and […]

Read more

Matrix Multiplication - November 1, 2022

Introduction Matrix multiplication is a fundamental operation in computer science and has widespread applications in various domains, including data processing, machine learning, computer graphics, and scientific computing. In this tech blog, we will explore the importance of matrix multiplication, its basic concepts, different methods for performing matrix multiplication, and its relevance in data-driven applications. Why […]

Read more

Binary Search - November 1, 2022

Introduction Searching for a specific item in a large dataset is a common task in computer programming. One efficient algorithm for performing such searches is the Binary Search algorithm. Binary Search is a powerful and widely used algorithm that is particularly suited for searching in sorted arrays. In this tech blog, we will explore the […]

Read more

Insertion Sort - November 1, 2022

Introduction Sorting is a fundamental operation in computer programming, and there are many algorithms available for this purpose. One popular and simple sorting algorithm is Insertion Sort. It’s a comparison-based sorting algorithm that works by dividing the dataset into two parts: a sorted part and an unsorted part. The algorithm repeatedly takes an element from […]

Read more

Bubble Sort - November 1, 2022

Introduction In the world of computer programming, sorting algorithms play a crucial role in organizing and arranging data in a specific order. One popular but simple algorithm is the Bubble Sort, which is often used to sort small datasets or as an educational tool for beginners to understand the basic principles of sorting algorithms. In […]

Read more

Shortest Path (Dijkstra) - October 28, 2022

Python Implementation This implementation uses an indexed minimum priority queue data structure.

Read more

1 2