Data Structure and Algorithms – Trees

Data Structures: Tree Basics A tree is a non-linear hierarchical data structure consisting of nodes connected by edges. Hover over nodes to see their terminology. Root Internal Leaf Leaf Leaf Hover over a node to see terminology… N-ary Trees A tree where a node can have at most N children. This example shows a 4-ary ... Read More

Hashing, Hash Tables and Scatter Tables

1. Hashing The process of transforming input data (a Key) of any size into a fixed-size value (a Hash). This value is usually a single number. 2. Hash Table A data structure that stores Key-Value pairs. It uses Hashing to calculate an index into an array, allowing you to find any entry instantly (O(1)). 3. ... Read More

Fundamental Data Structures – DSA

1. Dynamic Arrays A dynamic array grows automatically when it runs out of space. Watch what happens when the capacity (initially 4) is reached! Push Element Reset Current Capacity: 4 | Elements: 0 Real-World Examples: Shopping Carts: E-commerce sites use dynamic arrays to store items in your cart because they don’t know how many items ... Read More

Asymptotic Lower Bound – Omega

Resources: What is Asymptotic Lower Bound? In the world of algorithm analysis, Asymptotic Lower Bound, denoted by the Greek letter Omega ($\omega$), is used to describe the “best-case” or the minimum rate of growth for a function as the input size n approaches infinity. Think of it as a guarantee. If an algorithm has a ... Read More

Big Oh Expressions Reference

Big-O Time Complexity O(1) Constant time — stays the same regardless of input size. O(log n) Logarithmic — grows very slowly (e.g., binary search). O((log n)2) Log-squared — slightly faster growth than log n. O(√n) Square root — moderate growth, better than linear. O(n) Linear — grows directly with input size. O(n log n) Efficient ... Read More

Asymptotic Notation: Upper Bound (Big Oh) – DSA

Reference: Key Concept: Suppose, we have two algorithms A and B, then how do we decide which algorithm is better? Upper Bound – Big Oh What is upper bound for a function f(n)? The formal definition can be Formal Definition: Big O Notation For a function \( f(n) \) that is non-negative for all integers ... Read More

Time Complexity – Computer Science

Complexity Hierarchy Logarithmic: $O(\log n)$ The “Sublinear” breakthrough. Allows processing of massive matrices by only sampling specific parts. Linear: $O(n)$ The “Old” Standard. Required reading the entire input, which is impossible for modern recommendation scales. Polynomial: $O(poly(k))$ The “Classical Analogue.” While slower than quantum, it remains fast enough to be practical. Exponential: $O(2^n)$ The “Quantum ... Read More

Algorithm Analysis

Resources: What is Algorithm? Asymptotic Notation In computer science, Asymptotic Notation is a mathematical language used to describe the efficiency of an algorithm as the input size (usually called $n$) grows toward infinity. It allows us to ignore hardware-specific details (like processor speed) and focus purely on how the time or space requirements of a ... Read More

Data Structure and Algorithms – Queues

Resources: Queues are one of the most intuitive and widely used data structures in computer science. If you’ve ever waited in line at a coffee shop, ticket counter, or printer, you’ve already experienced a queue in real life! What is a Queue? A queue is an abstract data type that follows the FIFO principle – ... Read More

Data Structure and Algorithms – Stacks

Resources: 1. What is Stack? A Stack is one of the most fundamental linear data structures in computer science. If you’ve ever piled up a stack of cafeteria trays or used the “Undo” button in a text editor, you’ve already interacted with a stack in the real world. A stack is a linear data structure ... Read More
error: