# Algorithms

## KMP String Search Algorithm

Explaination of Knuth–Morris–Pratt string-searching algorithm (or KMP).

## 3 Slowest Sorting Algorithms

Do you know which is the slowest sorting algorithm? Let’s have fun with bogosort, sleep sort, and slow sort!

Breadth-First-Search(BFS) explained with visualization, a queue is used in the implementation.

## Depth-First-Search(DFS) Explained With Visualization

Depth-First-Search(DFS) explained with visualization, contains implementations of iterative version and recursive version.

## Using Disjoint Set (Union-Find) to Build a Maze Generator

In this post, we will learn how disjoint-set(union-find) data structure works, then we implement a maze generator with it.

## Random Number and Card Shuffling Algorithm

The random number is an important topic in computer science. In this post, we will discuss how random numbers are generated, how to use random numbers to shuffle cards.

## Quicksort: two styles of implementations

Use quicksort as an example, explain my method for learning algorithms effectively, explore the differences between imperative and functional programming styles.

## How to learn data structures and algorithms (An ultimate guide for beginners)

This is a roadmap and tips for you to learn data structures and algorithms. This post also contains books and resources for learning.

## How to randomize (shuffle) a JavaScript array?

In this post, we will write a function to randomize(shuffle) a JavaScript array.

## LeetCode: Merge Two Sorted Lists

Solution for LeetCode: Merge Two Sorted Lists