DEV Community

Algorithm of the Day Series' Articles

Back to Alisa Bajramovic's Series
The Happy Number Problem

The Happy Number Problem

78
Comments 9
4 min read
Kadane's Algorithm & The Maximum Subarray Problem
Cover image for Kadane's Algorithm & The Maximum Subarray Problem

Kadane's Algorithm & The Maximum Subarray Problem

52
Comments 3
5 min read
Finding the Only Single Number in an Array

Finding the Only Single Number in an Array

20
Comments 4
3 min read
Finding the Middle of a Linked List
Cover image for Finding the Middle of a Linked List

Finding the Middle of a Linked List

34
Comments 2
3 min read
Backspace String Comparisons: Two Ways To Approach a Common Algorithm
Cover image for Backspace String Comparisons: Two Ways To Approach a Common Algorithm

Backspace String Comparisons: Two Ways To Approach a Common Algorithm

11
Comments 6
7 min read
The Stock Span Problem: Using Stacks To Keep Track Of What's Been Seen

The Stock Span Problem: Using Stacks To Keep Track Of What's Been Seen

10
Comments 1
5 min read
Finding the Kth Smallest Element: Walking Through How To Use Depth First Search on a Binary Search Tree
Cover image for Finding the Kth Smallest Element: Walking Through How To Use Depth First Search on a Binary Search Tree

Finding the Kth Smallest Element: Walking Through How To Use Depth First Search on a Binary Search Tree

11
Comments
6 min read
The Boyer-Moore Majority Vote Algorithm: Finding the Majority Element in an Array
Cover image for The Boyer-Moore Majority Vote Algorithm: Finding the Majority Element in an Array

The Boyer-Moore Majority Vote Algorithm: Finding the Majority Element in an Array

19
Comments 2
5 min read
Sorting Characters in a String By Their Frequency

Sorting Characters in a String By Their Frequency

13
Comments 2
3 min read
Finding the Intersection of Two Arrays

Finding the Intersection of Two Arrays

8
Comments 1
3 min read
Finding the Minimum Path Sum in a Grid with Dynamic Programming
Cover image for Finding the Minimum Path Sum in a Grid with Dynamic Programming

Finding the Minimum Path Sum in a Grid with Dynamic Programming

9
Comments 1
7 min read
Floyd's Tortoise and Hare Algorithm: Finding a Cycle in a Linked List
Cover image for Floyd's Tortoise and Hare Algorithm: Finding a Cycle in a Linked List

Floyd's Tortoise and Hare Algorithm: Finding a Cycle in a Linked List

112
Comments 7
4 min read
The Sieve of Eratosthenes: Counting the Number of Primes

The Sieve of Eratosthenes: Counting the Number of Primes

13
Comments
3 min read
Add Two Numbers Problems: How to Sum Two Linked Lists
Cover image for Add Two Numbers Problems: How to Sum Two Linked Lists

Add Two Numbers Problems: How to Sum Two Linked Lists

26
Comments 3
6 min read
The Longest Substring With No Repeating Characters
Cover image for The Longest Substring With No Repeating Characters

The Longest Substring With No Repeating Characters

11
Comments 1
6 min read
Merging Sorted Lists, Two Ways

Merging Sorted Lists, Two Ways

12
Comments
9 min read
Finding the Longest Common Prefix
Cover image for Finding the Longest Common Prefix

Finding the Longest Common Prefix

12
Comments 2
5 min read
Reversing a String in Place
Cover image for Reversing a String in Place

Reversing a String in Place

14
Comments 2
4 min read
The ZigZag Conversion Problem

The ZigZag Conversion Problem

26
Comments 1
7 min read
The Longest Palindromic Substring: Solving the Problem Using Constant Space
Cover image for The Longest Palindromic Substring: Solving the Problem Using Constant Space

The Longest Palindromic Substring: Solving the Problem Using Constant Space

67
Comments 5
14 min read
Removing an Element in an Array In-Place
Cover image for Removing an Element in an Array In-Place

Removing an Element in an Array In-Place

23
Comments 2
5 min read
Solving the Best Time to Buy and Sell Stocks Problem in One Pass
Cover image for Solving the Best Time to Buy and Sell Stocks Problem in One Pass

Solving the Best Time to Buy and Sell Stocks Problem in One Pass

27
Comments 2
7 min read
Don't Underestimate the Two Pointers: Removing the N-th Node from the End of a Linked List
Cover image for Don't Underestimate the Two Pointers: Removing the N-th Node from the End of a Linked List

Don't Underestimate the Two Pointers: Removing the N-th Node from the End of a Linked List

11
Comments
5 min read
Not an "Easy" Algorithm: Rotating an Array, Three Ways
Cover image for Not an "Easy" Algorithm: Rotating an Array, Three Ways

Not an "Easy" Algorithm: Rotating an Array, Three Ways

88
Comments 19
11 min read
Sudoku Part I: Is the Board Valid?
Cover image for Sudoku Part I: Is the Board Valid?

Sudoku Part I: Is the Board Valid?

10
Comments
9 min read
Searching an Array, Two Ways
Cover image for Searching an Array, Two Ways

Searching an Array, Two Ways

9
Comments 3
6 min read
The Climbing Staircase Problem: How to Solve It, and Why the Fibonacci Numbers are Relevant
Cover image for The Climbing Staircase Problem: How to Solve It, and Why the Fibonacci Numbers are Relevant

The Climbing Staircase Problem: How to Solve It, and Why the Fibonacci Numbers are Relevant

119
Comments 10
5 min read
Transposing and Reversing: How to Rotate a 2D Matrix 90 Degrees

Transposing and Reversing: How to Rotate a 2D Matrix 90 Degrees

19
Comments 2
6 min read
Turning 38 into 2: How to Solve the Add Digits Problem

Turning 38 into 2: How to Solve the Add Digits Problem

11
Comments 7
5 min read
The Gauss Sum, and Solving for the Missing Number
Cover image for The Gauss Sum, and Solving for the Missing Number

The Gauss Sum, and Solving for the Missing Number

14
Comments 2
3 min read
Is this Number the Sum of Two Square Integers? Solving The Sum of Squares Algorithm Two Ways

Is this Number the Sum of Two Square Integers? Solving The Sum of Squares Algorithm Two Ways

8
Comments
4 min read
The Word Pattern Algorithm: How to Test if a String Follows a Pattern

The Word Pattern Algorithm: How to Test if a String Follows a Pattern

12
Comments 1
5 min read
Finding the Intersection of Two Arrays

Finding the Intersection of Two Arrays

10
Comments 1
3 min read
Top Interview Question: Finding the First Unique Character in a String using Linear Time
Cover image for Top Interview Question: Finding the First Unique Character in a String using Linear Time

Top Interview Question: Finding the First Unique Character in a String using Linear Time

16
Comments 2
4 min read
Solving Pascal's Triangle in JavaScript

Solving Pascal's Triangle in JavaScript

31
Comments 3
4 min read
The Maximum Number of Events Problem

The Maximum Number of Events Problem

13
Comments
5 min read
Solving Binary Tree Algorithms Using Recursion and Queues
Cover image for Solving Binary Tree Algorithms Using Recursion and Queues

Solving Binary Tree Algorithms Using Recursion and Queues

11
Comments
5 min read
From "hello world" to "world hello": Reversing the Words in a String

From "hello world" to "world hello": Reversing the Words in a String

17
Comments 4
4 min read
Finding the Most Frequent Elements in an Array
Cover image for Finding the Most Frequent Elements in an Array

Finding the Most Frequent Elements in an Array

12
Comments 1
4 min read
Finding the Angle Between the Hands of a Clock
Cover image for Finding the Angle Between the Hands of a Clock

Finding the Angle Between the Hands of a Clock

29
Comments 1
5 min read
The Container with the Most Water: Solving an Algorithm about Areas
Cover image for The Container with the Most Water: Solving an Algorithm about Areas

The Container with the Most Water: Solving an Algorithm about Areas

7
Comments
5 min read