The Baeldung logo
  • The Baeldung LogoCS Sublogo
  • Start Here
  • Write for Baeldung
  • About ▼▲
    • Full Archive

      The high level overview of all the articles on the site.

    • About Baeldung

      About Baeldung.

Algorithms

Algorithms are one of the foundational concepts in programming.

We’re exploring the basics of Computer Science here, and a lot more here, on the Java side.

  • Binary Tree (18)
  • Array (16)
  • Dijkstra (11)
  • Optimization (10)
  • QuickSort (5)
  • Linked List (5)
  • Merge Sort (4)
  • Prim (4)
  • Metaheuristics (3)
  • NP-Complete (3)
  • Kruskal (2)
  • reference (2)

>> Defining Multiobjective Algorithms and Pareto Frontiers

>> How to Convert Finite Automata to Regular Expressions?

>> Recursion: Direct vs Indirect

>> Firefly Algorithm

>> Skip List Comparison with Binary Search Tree

>> Isomorphic Trees

>> The Centers of Unweighted Trees

>> Hashing – Linear Probing

>> Optimization: Gradient-Based Algorithms

>> Quadtrees and Octrees

>> Merge Sort: Top-Down Vs. Bottom-up

>> Artificial Bee Colony

>> Genetic Algorithms: Crossover Probability and Mutation Probability

>> 2-Way and K-Way Merging

>> Shuffling an Array

>> Tabu Search

>> Quicksort vs. Timsort

>> Linear Search With Fewer Comparisons

>> Comb Sort Explained

>> Decrease-Key Dijkstra’s Algorithm

>> How to Calculate the Angle from Rotation Matrix

>> How Does Particle Swarm Optimization Work?

>> Pigeonhole Sort Explained

>> Gravity/Bead Sort

>> Getting the Closest String Match

>> The de Bruijn Sequence

>> Bitonic Sort

>> Simultaneous Localization and Mapping

>> Cocktail Sort

>> The Complexity of Shellsort

>> Multithreaded Algorithms

>> Harris Corner Detection Explained

>> Algorithm for Merging Two Max Heaps

>> How to Check If a String Is a Palindrome?

>> Why Isn’t Heapsort Stable?

>> How to Calculate the Star Rating

>> Counting Sort vs. Bucket Sort vs. Radix Sort

>> Heuristics Vs. Meta-heuristics Vs. Probabilistic Algorithms

>> Odd-Even Transposition Sort

>> Finding the nth Element of a Singly Linked List

>> Differences Between Porter and Lancaster Stemming Algorithms

>> Elitism in Evolutionary Algorithms

>> Fibonacci Search

>> Understanding Heapsort

>> Algorithms and Flowcharts: Mapping Process

>> Minimum Stack With O(1) Time

>> Jump Search Algorithm

>> Fuzzy Search Algorithm for Approximate String Matching

>> Exponential Search

>> The Sleeping Barber Problem

>> Data Compression: ZLib vs. GZip vs. Zip

>> Drawing Shapes with Marching Squares

>> Median of a Matrix With Sorted Rows

>> The Dining Philosophers

>> Non-repeating Random Number Generator

>> Which Is Faster – Hash Lookup or Binary Search?

>> How to Find Common Elements in Two Sorted Arrays

>> MapReduce Algorithm

>> How to Compute the Similarity of Colours

>> Introduction to Bloom Filter

>> How to Calculate the Runtime Percentage Improvement

>> How to Convert a Color From HSL to RGB

>> Overview of Nature-Inspired Metaheuristic Algorithms

>> What is Markov Chain Monte Carlo?

>> Efficiently Sorting Linked Lists

>> Understanding Hash Tables

>> Ant Lion Optimization

>> Finding the Minimum Number of Jumps to Reach the End of an Array

>> How to Find the Minimum Difference Between Elements in an Array

>> Dragonfly Algorithm

>> Algorithm to Find All Subarrays With a Given Sum K

>> Find the Kth Smallest Element in a Binary Search Tree

>> How to Find the Two Points With the Minimal Manhattan Distance

>> Antipatterns: Magic Numbers

>> Finding the Number of Distinct Subsequences of a String

>> How to Test If a Number is a Fibonacci Number

>> How To Find a List of Possible Words From a Letter Matrix

>> Hill Climbing Algorithm

>> Generating a Crossword Puzzle

>> Salp Swarm Algorithm

>> What Is the Best Sorting Algorithm To Sort an Array of Small Integers

>> How To Determine if a Point Is in a 2D Triangle

>> How to Convert an RGB Image to a Grayscale

>> Pseudo-Polynomial vs. Polynomial Complexity

>> DES vs 3DES vs Blowfish vs AES

>> Is Selection Sort Stable?

>> Number of Comparisons in Straight Selection Sort

>> What is a Random Walk?

>> Multi-Verse Optimizer

>> Radix Sort

>> How to Check String Periodicity

>> Binary Insertion Sort

>> Moth Flame Optimization

>> Applications of Red-Black Trees

>> Why Can’t Prim’s or Kruskal’s Algorithms be Used on a Directed graph?

>> How to Sort Mostly Sorted Arrays

>> Prim’s Algorithm

>> Rank of a Node in a Binary Search Tree

>> Finding the In-Order Successor of a Node

>> Backtracking vs. Depth-First Search

>> Streaming Median

>> An Introduction to the Voronoi Diagram

>> The Difference Between a Heuristic and an Algorithm

>> Circle Line-Segment Collision Detection Algorithm

>> Minimax Algorithm

>> The Akra-Bazzi Method

>> Bidirectional Search for Path Finding

>> Calculating Total Transmission Time of a Packet

>> How to Solve Constraint Satisfaction Problems

>> Expectimax Search Algorithm

>> Grasshopper Optimization Algorithm

>> Finding Arrangements of Blocks With L Left Visible Blocks and R Right Visible Blocks

>> Dijkstra vs. A* – Pathfinding

>> Count the Number of Set Bits in an Integer

>> Depth-First Search vs. Breadth-First Search

>> Graph Search vs. Tree-Like Search

>> Uniform-Cost Search vs. Best-First Search

>> The Informed Vs. Uninformed Search Algorithms

>> Finding All Tic-Tac-Toe Winning Combinations

>> Tracing the Path in DFS, BFS, and Dijkstra’s Algorithm

>> Beam Search Algorithm

>> Iterative Deepening vs. Depth-First Search

>> An Algorithm for Inflating and Deflating Polygons

>> Finding the Largest Balanced Subarray

>> Finding the Number of Occurrences of a Subsequence in a String

>> Hill Climbing Search vs. Best First Search

>> Find the Majority Element of an Array

>> Complexity Analysis of QuickSelect

>> Finding Dates, Times and Addresses in Emails

>> Finding the Volume of Water Collected Between Towers

>> Candidate Elimination Algorithm

>> Knight’s Shortest Path on Chessboard

>> Edge Relaxation in Dijkstra’s Algorithm

>> Finding the K Smallest Numbers in an Array

>> An Overview of Evolutionary Algorithms

>> Sine Cosine Algorithm

>> Out-of-bag Error in Random Forests

>> Introduction to ASCII Code

>> External Sorting vs Internal Sorting

>> How to Find an Area of Overlapping Rectangles

>> Binary Search Tree with Strings

>> When Will the Worst Case of Merge Sort Occur?

>> Searching in a Sorted and Rotated Array

>> Grey Wolf Optimization Algorithm

>> Finding the Only Unpaired Element in the Array

>> Finding Maximum Size Square in a Matrix Filled With Ones

>> Dijkstra vs Floyd-Warshall Algorithms

>> Calculate the Number of Binary Search Trees with N Distinct Elements

>> The Most Efficient Way to Implement an Integer Based Power Function

>> Finding the Next Smaller Element for Each Element in an Array

>> Algorithms to Check If a Number Is a Power of 2

>> Merging Two Binary Search Trees

>> Understanding Time Complexity Calculation for Dijkstra Algorithm

>> Number of Nodes in a Binary Tree With Level N

>> Intuition Behind Gradient Descent Algorithm

>> Minimum Number of Steps to Reduce Number to One

>> Time Complexity vs. Space Complexity

>> Negative Weights Using Dijkstra’s Algorithm

>> Difference between Big-O and Little-o Notations

>> Quicksort vs. Heapsort

>> Divide and Conquer vs. Dynamic Programming

>> Which Sorting Algorithm to Use?

>> What Is a Heuristic Function?

>> Print All Paths With a Given Sum in a Binary Tree

>> Applications of Binary Trees

>> Insertion Sort vs. Bubble Sort Algorithms

>> Pairing Socks From a Pile Efficiently

>> Generative vs. Discriminative Algorithms

>> Quicksort vs. Mergesort

>> Understanding Complexity of Cryptographic Algorithms

>> Finding the Shortest Path in a Graph Visiting All Nodes

>> String Similarity Metrics: Sequence Based

>> Appointment Scheduling Algorithm

>> Obtaining the Path in the Uniform Cost Search Algorithm

>> Topic Modeling with Word2Vec

>> Comparison Between Uniform-Cost Search and Dijkstra’s Algorithm

>> Finding the Lowest Common Ancestor in a Directed Acyclic Graph

>> Correlated Features and Classification Accuracy

>> Weakly Supervised Learning

>> Find Local Minimum in N x N Matrix

>> What Is the Time Complexity of Tree Traversal?

>> Minimum Cut on a Graph Using a Maximum Flow Algorithm

>> How to Determine if a List of Polygon Points Are in Clockwise Order

>> Flood Fill Algorithm

>> Complexity of Inserting N Numbers into a Binary Search Tree

>> Time Complexity of Sieve of Eratosthenes Algorithm

>> Number of Shortest Paths in a Graph

>> Find Cycle Start Node in a Singly Linked List

>> Sum of Digits in Factorial

>> Backtracking Algorithms

>> Calculating the Height of a Binary Tree

>> How to Calculate the Number of Different Binary and Binary Search Trees

>> Topic Modeling with Latent Dirichlet Allocation

>> String Similarity Metrics – Edit Distance

>> Time Complexity of Searching in a Balanced Binary Search Tree

>> Time Complexity of Inserting into a Heap

>> Algorithm to Generate a Maze

>> Algorithms to Check If a Linked List is a Circular Linked List

>> Max-Heapify A Binary Tree

>> Traveling Salesman Problem – Dynamic Programming Approach

>> Fundamental Difference Between Hashing and Encryption Algorithms

>> Matrix Multiplication Algorithm Time Complexity

>> Heap vs Binary Search Tree

>> Counting Inversions in an Array

>> Converting a Word to a Vector

>> Time Complexity of Euclid’s Algorithm

>> Greedy Algorithm to Find Minimum Number of Coins

>> Finding a Cycle in a Singly Linked-List

>> Finding the Most Significant Bit

>> Generate All Permutations of an Array

>> Non-Recursive Merge Sort

>> Introduction to Depth First Search Algorithm (DFS)

>> Using Leaf Count to Find Total Number of Nodes in a Full K-Ary Tree

>> Algorithm for “Nice” Grid Line Intervals on a Graph

>> Roulette Selection in Genetic Algorithms

>> Merge Two Sorted Arrays Into a Sorted Array

>> Efficient Ways to Find the Intersection of Lists

>> Geofencing – Determining Whether a Point is Inside of a Polygon

>> Choosing an Attractive Linear Scale for a Graph’s Y Axis

>> Remove Duplicates From a Linked List

>> How Does the Google “Did You Mean?” Algorithm Work?

>> Getting a Path From a Root to a Node in a Binary Tree

>> Worst Sorting Algorithms – What to Avoid

>> Brute Force Algorithm in Cybersecurity and String Search

>> Palindromic Substrings in O(n) with Manacher’s Algorithm

>> Finding All Overlapping Intervals

>> Peak Detection in a Measured Signal

>> Peak detection in a 2D Array

>> Find All Simple Paths Between Two Vertices in a Graph

>> How to Reverse a Linked List

>> Determine Whether Two Nodes in a Graph Are Connected

>> Choosing the Subarray That Adds Up to a Target Number

>> Sort Points in Clockwise Order

>> Finding the Kth Smallest Element in the Union of Two Sorted Arrays

>> Find the Subset of Numbers That Add Closest to Target Number

>> Find the Next Higher Number

>> How to Calculate the Area of a 2D Polygon?

>> Branch and Bound Algorithm

>> Reconstructing a Tree From Its Depth-First Traversals

>> Looping in a Spiral

>> What the Correlation Coefficient Actually Represents

>> Create Balanced Binary Search Tree From Sorted List

>> A* Pathfinding Algorithm

>> Overview of Rabin-Karp Algorithm

>> How to Prove That a Problem Is NP-Complete?

>> Quicksort Worst Case Time Complexity

>> Overview of Dijkstra’s Algorithm

>> Implementing the Decrease-Key Operation for Min-Heaps

>> Levenshtein Distance Computation

>> Dijkstra’s vs Bellman-Ford Algorithm

>> Computing Bubble Sort Time Complexity

>> Sorting the Elements in a Binary Tree

>> The Complexity of Towers of Hanoi

>> How to Find Total Number of Minimum Spanning Trees in a Graph?

>> Detecting Cycles in a Directed Graph

>> Floyd-Warshall Algorithm: Shortest Path Finding

>> Topological Sort of Directed Acyclic Graph

>> Finding Articulation Points of a Graph

>> Kruskal’s vs Prim’s Algorithm

>> Computing the Diameter of a Network

>> Determine Maximum Number of Edges in a Directed Graph

>> 0-1 Knapsack: A Problem With NP-Completeness and Solvable in Pseudo-Polynomial Time

>> How to Find If a Graph Is Bipartite?

>> Stemming vs Lemmatization

>> Divide and Conquer Algorithms

>> Shortest Path to Certain Nodes in a Graph

>> Fibonacci: Top-Down vs Bottom-Up Dynamic Programming

>> Determining Whether a Directed or Undirected Graph Is a Tree

>> Hamiltonian vs Euler Path

>> Bellman Ford Shortest Path Algorithm

>> Linear Search vs Binary Search

>> Finding the Lowest Common Ancestor of Two Nodes in a Binary Tree

>> Finding the Maximum-Minimum Capacity For a Node in a Graph

>> Longest Palindromic Subsequence With Dynamic Programming

>> Minimum Spanning Tree Vs Shortest Path Tree

>> Knuth-Morris-Pratt Algorithm

>> What is the Optimal Algorithm for the Game 2048?

>> Difference Between BFS and Dijkstra’s Algorithms

>> Cycles in an Undirected Graph

>> Greedy Approach vs Dynamic Programming

>> Genetic Algorithms vs Neural Networks

>> Solving Binary Gap Using Recursion

>> Longest Increasing Subsequence Using Dynamic Programming

>> Clustering Into an Unknown Number of Clusters

>> Computational Complexity of Fibonacci Sequence

>> Methods of Depth First Traversal and Their Applications

>> Logarithmic Time Complexity

>> P, NP, NP-Complete and NP-Hard Problems in Computer Science

>> An Overview of QuickSort Algorithm

>> An Introduction to the Theory of Asymptotic Notations

>> Stable Sorting Algorithms

>> Difference Between Prim’s and Dijkstra’s Algorithms

  • ↑ Back to Top
The Baeldung logo

Categories

  • Algorithms
  • Artificial Intelligence
  • Core Concepts
  • Data Structures
  • Graph Theory
  • Latex
  • Networking
  • Security

Series

About

  • About Baeldung
  • The Full archive
  • Write for Baeldung
  • Editors
  • Terms of Service
  • Privacy Policy
  • Company Info
  • Contact
The Baeldung Logo