TongTong Shi's Blog
A Playground to Share My Knowledge
Union Find Set Union Find Set
1. Introduction 2. Methods2.1 find()The average time complexity of compressed find is O(1). public int find(int x) {
2019-05-12 Tong Shi
Wiggle Sort II Wiggle Sort II
LeetCode Q 324 - Wiggle Sort IIGiven an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] <
2019-05-09 Tong Shi
Valid Palindrome Valid Palindrome
LeetCode Q 125 - Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characte
2019-05-09 Tong Shi
3Sum Closest 3Sum Closest
LeetCode Q 16 - 3Sum ClosestGiven an array nums of n integers and an integer target, find three integers in nums such th
2019-05-09 Tong Shi
Sort an Array Sort an Array
LeetCode Q 912 - Sort an ArrayGiven an array of integers nums, sort the array in ascending order. Example 1:Input: [5,2,
2019-05-09 Tong Shi
Sort Colors Sort Colors
LeetCode Q 75 - Sort ColorsGiven an array with n objects colored red, white or blue, sort them in-place so that objects
2019-05-09 Tong Shi
42 / 79