ylqi007 / LeetCode

21 stars 6 forks source link

Algorithm (算法) #19

Open ylqi007 opened 11 months ago

ylqi007 commented 11 months ago

Quick Select

Quickselect (Hoare's selection algorithm)

  1. 215. Kth Largest Element in an Array [讲解不错,算法实现简单易明白]
  2. 347. Top K Frequent Elements
ylqi007 commented 9 months ago

Sorting

  1. 88. Merge Sorted Array
    1. 21. Merge Two Sorted Lists
    2. 977. Squares of a Sorted Array [Two Pointers]
    3. 986. Interval List Intersections
  2. :white_check_mark: 56. Merge Intervals
    1. 252. Meeting Rooms [Arrays.sort(), no overlop]
    2. :white_check_mark: 253. Meeting Rooms II
    3. 2402. Meeting Rooms III [Sorting, PriorityQueue]
    4. 986. Interval List Intersections [Merge overlap]
  3. 1. Two Sum
    1. 167. Two Sum II - Input Array Is Sorted [Two pointers]
    2. 170. Two Sum III - Data structure design [未做]
    3. 653. Two Sum IV - Input is a BST [Two Sum II + Tree]
    4. 1099. Two Sum Less Than K [Sort, Two Sum II, Two Pointers]
  4. :white_check_mark: 15. 3Sum
    1. 1. Two Sum
    2. 16. 3Sum Closest [Two pointers; Binary Search]
    3. 259. 3Sum Smaller [Two pointers; Binary Search]
    4. :white_check_mark: 18. 4Sum [Two pointers, recursion]
  5. 49. Group Anagrams
    1. 242. Valid Anagram
    2. 249. Group Shifted Strings
    3. 2273. Find Resultant Array After Removing Anagrams
  6. :white_check_mark: 1235. Maximum Profit in Job Scheduling [DP + Binary Search, Binary Search是重点]
    1. :white_check_mark: 2008. Maximum Earnings From Taxi [DP; PriorityQueue]
    2. 2054. Two Best Non-Overlapping Events [PriorityQueue; Binary Search]
  7. :white_check_mark: 2516. Take K of Each Character From Left and Right [Sliding Window]

Sliding window 和 Two pointers意义很相近。根据个人习惯,可以将长度不固定的叫two pointers,长度固定的叫sliding window

ylqi007 commented 9 months ago

Binary Search

ylqi007 commented 9 months ago

Dynamic Programming

Reference