Skip to content
shawnlyu

shawnlyu

Velut arbor aevo.

  • Home
  • Algorithms
  • Tech
  • Snowboarding
  • About me
  • Account
    • Register
    • Edit Profile
    • Log In

Category: Algorithms

Posts that introduces some specific algorithms or problems.

Posted on November 13, 2020July 8, 2021

LeetCode Authorized Author

LeetCode_logo

I’ve joined LeetCode’s Content Creator Team to publish official solutions since Oct 26, 2020. Here you may find some of my work that’s published on LeetCode:

Continue reading “LeetCode Authorized Author”
Posted on September 15, 2020September 15, 2020

Disjoint Set – Union & Find

In computer science, a disjoint-set data structure … is a data structure that stores a collection of disjoint (non-overlapping) sets. … It provides operations for adding new sets, merging sets (replacing them by their union), and finding a representative member of a set.

Source: https://en.wikipedia.org/wiki/Disjoint-set_data_structure
Continue reading “Disjoint Set – Union & Find”
Posted on September 15, 2020September 15, 2020

Minimum Spanning Tree – Prim

A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges of a connected, edge-weighted undirected graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight.

Source: https://en.wikipedia.org/wiki/Minimum_spanning_tree
Continue reading “Minimum Spanning Tree – Prim”
Posted on August 19, 2020August 26, 2021

Binary Search – Find Upper and Lower Bound

This post will introduce one specific application of Binary Search, i.e., when you are asked to find the upper or lower bound, or more precisely, when you need to find the maximum of the smallest value or the minimum of the largest value.

Continue reading “Binary Search – Find Upper and Lower Bound”
Posted on August 17, 2020August 17, 2020

BFS and Bi-directional BFS

Apart from vanilla BFS introduced in Intro to Graph Algorithms – BFS & DFS, there’s another variant of BFS called bi-directional BFS. Instead of searching from source to target, bi-directional BFS starts with the source and the target at the same time, and search the graph simultaneously. The improvement of time complexities is shown as below, as referring to @Huahua.

Continue reading “BFS and Bi-directional BFS”
Posted on July 6, 2020July 12, 2020

Floyd’s Cycle Detection Algorithm – [Leetcode]142. Linked List Cycle II

The cycle detection problem is to find the cycle in a sequence, and Floyd’s cycle detection algorithm, aka Tortoise and Hare algorithm, is a two pointers algorithm to detect the cycle and the start of the cycle as well.

Continue reading “Floyd’s Cycle Detection Algorithm – [Leetcode]142. Linked List Cycle II”
Posted on July 3, 2020July 9, 2020

Intro to Trie (Prefix Tree) – FEAT. Leetcode 208. Implement Trie

A trie, or a prefix tree, refers to an ordered data structure that is usually used to store strings (Wikipedia). The picture on the above is an example where a trie stores [ape,apple,are,art]. Now let’s take a closer look at it and it’s not hard to find that:

Continue reading “Intro to Trie (Prefix Tree) – FEAT. Leetcode 208. Implement Trie”
Posted on June 15, 2020June 26, 2020

Shortest Path Algorithms I – Dijkstra

The shortest path problem is the problem of finding a path between two vertices in a graph such that the sum of the weights of its constituent edges is minimized. (Wikipedia) In this and coming posts some of the most common algorithms to solve the shortest path problems will be explained. Today’s topic is Dijkstra.

Continue reading “Shortest Path Algorithms I – Dijkstra”

Posts navigation

Page 1 Page 2 Next page

Recent Posts

  • Intro to Kafka – 1
  • LeetCode Authorized Author
  • Database Index
  • Java Garbage Collection
  • [Leetcode]1626. Best Team With No Conflicts

Recent Comments

  • PPSC DAILY QUIZ on LeetCode Authorized Author
  • shawnlyu on Binary Search – Find Upper and Lower Bound
  • Robert on Binary Search – Find Upper and Lower Bound
  • shawnlyu on Database Index
  • Duddupudi Sai Avinash on Database Index

Categories

  • Algorithms (16)
  • Leetcode (71)
  • Snowboarding (1)
  • Tech (3)

Tags

  • array
  • backtracking
  • bfs
  • binary search
  • bit operation
  • bitwise operators
  • bucket sort
  • complexity analysis
  • cycle detection
  • dfs
  • dijkstra
  • divide and conquer
  • dp
  • easy
  • graph algorithms
  • greedy
  • hard
  • hashmap
  • heap
  • inorder
  • insertion sort
  • Leetcode
  • Leetcode contest
  • Leetcode for interviews
  • math
  • medium
  • mergesort
  • monotone stack
  • postorder
  • prefix sum
  • preorder
  • pruning
  • quicksort
  • recursion
  • selection sort
  • shortest path
  • sliding window
  • sort
  • sorting algorithms
  • state machine
  • string
  • topological sort
  • Tree traversal
  • trie
  • two pointers

Archives

  • August 2021 (1)
  • November 2020 (2)
  • October 2020 (2)
  • September 2020 (20)
  • August 2020 (16)
  • July 2020 (24)
  • June 2020 (19)
  • May 2020 (7)

Pages

  • About me
  • Edit Profile
  • Log In
  • Register
  • Privacy Policy
  • Terms and Conditions

Visits

139956

Proudly powered by WordPress

Privacy Policy - Terms and Conditions