Data Structure / Algorithm

Understand abstract data types, object-oriented programming, and analysis of algorithms.


Related Posts

Data Structures: Hash Table

A foundational dictionary data structure allowing for $O(1)$ average associative lookups.

data-structures hash-table dictionary arrays

Leetcode 121: Best Time to Buy and Sell Stock

Iteratively updating minimums and maximum profits in a single pass

algorithms arrays optimal-substructure

Leetcode 704: Binary Search

A foundational $O(\log n)$ search algorithm for sorted arrays.

algorithms binary-search arrays dynamic-programming dp-1d

Leetcode 392: Is Subsequence

A two-pointer approach to check if one string is a subsequence of another

algorithms two-pointers strings same-direction-traversal

Leetcode 125: Valid Palindrome

A two-pointer approach to check if a string is a valid palindrome

algorithms two-pointers(inward) strings

Leetcode 283: Move Zeroes

A two-pointer approach to move all non-zero elements to the front of an array

algorithms two-pointers arrays same-direction-traversal taxi

Leetcode 13: Roman to Integer

algorithms strings arrays two-pointers sliding-window

Leetcode 69: Sqrt(x)

Computing the integer square root of a number using Binary Search.

algorithms binary-search math

Leetcode 1134: Armstrong Number

Determining if a number is an Armstrong number by extracting its digits.

algorithms math

Leetcode 169: Majority Element

Finding the majority element in an array using a Hash Map frequency table.

algorithms hash-table arrays taxi

Leetcode 242: Valid Anagram

Checking if two strings are anagrams of each other using a Hash Map.

algorithms hash-table strings taxi

Leetcode 1: Two Sum

Finding a pair of numbers that add up to a target dynamically using a one-pass Hash Map.

algorithms hash-table arrays

Leetcode 141: Linked List Cycle

Detecting a cycle in a linked list using Floyd's Tortoise and Hare algorithm.

algorithms linked-list two-pointers hash-table

Leetcode 914: X of a Kind in a Deck of Cards

Grouping elements by checking the Greatest Common Divisor (GCD) of their frequencies.

algorithms hash-table math arrays

Data Structures: Binary Search Tree

A node-based binary tree data structure with properties that make it highly efficient for searching, inserting, and deleting elements.

data-structures binary-search-tree tree algorithms

Introduction to Two Pointers

A comprehensive guide to the two-pointer algorithmic pattern

algorithms two-pointers

Leetcode 26: Remove Duplicates from Sorted Array

A two-pointer approach to remove duplicates in-place from a sorted array

algorithms two-pointers arrays

Leetcode 27: Remove Element

A two-pointer approach to remove a specific element in-place from an array

algorithms two-pointers arrays same-direction-traversal

Leetcode 160: Intersection of Two Linked Lists

Finding the node at which the intersection of two singly linked lists begins using the Two Pointers technique.

algorithms linked-list two-pointers

Leetcode 202: Happy Number

Determining if a number is a happy number using Hash Set and Two Pointers techniques.

algorithms math two-pointers hash-table

Leetcode 938: Range Sum of BST

Calculating the sum of all nodes in a given range by traversing a Binary Search Tree.

algorithms tree binary-search-tree depth-first-search

Leetcode 977. Squares of a Sorted Array

Solving the Squares of a Sorted Array problem using a Two Pointers approach.

leetcode two-pointers(inward) array algorithm

Project Updates