天天看点

错题集STL栈分治思维二分哈希字符串双指针链表数学知识树图动态规划DFSBFS排序模拟贪心

文章目录

  • STL
  • 分治
  • 思维
  • 二分
  • 哈希
  • 字符串
  • 双指针
  • 链表
  • 数学知识
  • 动态规划
  • DFS
  • BFS
  • 排序
  • 模拟
  • 贪心

STL

  1. ⭐PAT A1112 Stucked Keyboard
  2. ⭐PAT A1129 Recommendation System
  3. ⭐【优先队列】PAT A1014 Waiting in Line

  1. 表达式求值
  2. ⭐LeetCode 32. Longest Valid Parentheses
  3. ⭐⭐⭐⭐⭐【单调栈/动态规划】LeetCode 85. Maximal Rectangle
  4. ⭐⭐⭐⭐⭐【单调栈】LeetCode 84. 柱状图中最大的矩形

分治

  1. ⭐LeetCode 23. Merge k Sorted Lists

思维

  1. ⭐LeetCode 31. 下一个排列
  2. ⭐⭐⭐⭐⭐PAT A1148 Werewolf - Simple Version

二分

  1. ⭐⭐⭐LeetCode 4. Median of Two Sorted Arrays
  2. ⭐⭐⭐⭐⭐【二分(非常隐蔽)】PAT A1010 Radix
  3. ⭐⭐⭐⭐⭐【二分】PAT A1029 Median做过1次依然不会做的题,哭了,主要还是这个题思想有点偏了+我太笨了
  4. ⭐⭐⭐⭐⭐【二分法+双指针+抽屉原理】LeetCode 287. Find the Duplicate Number

哈希

  1. ⭐⭐⭐⭐⭐PAT A1145 Hashing - Average Search Time
  2. ⭐⭐⭐⭐⭐【前缀和+哈希优化】LeetCode 560. Subarray Sum Equals K

字符串

  1. ⭐PAT A1108 Finding Average
  2. ⭐⭐⭐⭐⭐【KMP & 最小循环节】Power Strings
  3. ⭐⭐⭐⭐⭐Seek the Name, Seek the Fame

双指针

天哪,我好像一道双指针都不会!淦!
  1. ⭐LeetCode 15. 3Sum
  2. ⭐LeetCode 76. Minimum Window Substring
  3. ⭐LeetCode 567. Permutation in String
  4. ⭐LeetCode 11. Container With Most Water

链表

  1. 快慢指针
  2. ⭐⭐⭐PAT A1074 Reversing Linked List
  3. ⭐⭐⭐⭐⭐【链表+归并排序】LeetCode 148. Sort List

数学知识

  1. 【PAT A1096】Consecutive Factors
  2. ⭐进制转换2——清华
  3. ⭐PAT A1152 Google Recruitment

  1. 二叉搜索树——浙大10年
  2. LeetCode 130. Surrounded Regions
  3. ⭐LeetCode 128. Longest Consecutive Sequence
  4. ⭐PAT A1123 Is It a Complete AVL Tree
  5. ⭐⭐⭐⭐⭐PAT A1143 Lowest Common Ancestor
  6. ⭐⭐⭐⭐⭐【并查集+树】Is It A Tree?没有理解树的定义,忽视了root的入度一定要为0这个条件
  7. ⭐⭐⭐⭐⭐【树的遍历和重构】LeetCode 297. Serialize and Deserialize Binary Tree

  1. LeetCode 1129. Shortest Path with Alternating Colors
  2. ⭐⭐⭐⭐⭐1139 First Contact (30分)
  3. ⭐⭐⭐⭐⭐PAT A1149 Dangerous Goods Packaging
  4. ⭐PAT A1072 Gas Station
  5. ⭐⭐⭐⭐⭐【带其他标尺的Dijkstra+DFS】PAT A1018 Public Bike Management

动态规划

  1. PAT A1068
  2. 搬寝室
  3. Greedy Tino
  4. Leetcode 10. Regular Expression Matching
  5. ⭐多重背包——珍惜现在,感恩生活
  6. ⭐【最大连续子序列和】A - Sum
  7. ⭐⭐⭐⭐⭐【动态规划】LeetCode 42. Trapping Rain Water
  8. ⭐⭐⭐【爬楼梯问题变形】LeetCode 300. Longest Increasing Subsequence 很多细节没有考虑到,提交错了好几次!!!
  9. ⭐⭐⭐⭐⭐【0-1背包变形+恰好装满+可行解】LeetCode 494. Target Sum
  10. ⭐⭐⭐⭐⭐【动态规划+股票系列】LeetCode 309. Best Time to Buy and Sell Stock with Cooldown
  11. ⭐⭐⭐⭐⭐【区间DP】LeetCode 312. Burst Balloons

DFS

  1. ⭐⭐⭐⭐⭐【DFS/剪枝】A - Sticks
  2. ⭐⭐⭐⭐⭐【图的遍历】POJ 1129 Channel Allocation
  3. ⭐⭐⭐⭐⭐【中序遍历、验证二叉搜索树】98. Validate Binary Search Tree
  4. ⭐⭐⭐⭐⭐101. Symmetric Tree
  5. ⭐⭐⭐⭐⭐【图的DFS进阶】最小路径串(这道题在普通的图DFS上加了遍历的优先级,nice)
  6. ⭐⭐⭐⭐⭐【网格型、暴力、DFS典型例题】POJ 2488 A Knights Journey
  7. ⭐⭐⭐⭐⭐【网格型DFS】POJ 2676 Sudoku
  8. ⭐⭐⭐⭐⭐【网格型DFS+BFS最短路究极版本】POJ 3083 Children of the Candy Corn
  9. ⭐⭐⭐⭐⭐【应用型DFS+剪枝】A - Sticks 这里的剪枝骚的1p
  10. ⭐⭐⭐⭐⭐POJ 2362 Square里面有代码细节我写错了

BFS

  1. ⭐⭐⭐⭐⭐【BFS求最小次数】LeetCode 279. Perfect Squares
  2. ⭐⭐⭐⭐⭐【BFS求最小次数】LeetCode 301. Remove Invalid Parentheses
  3. ⭐⭐⭐⭐⭐【多源BFS】LeetCode 1162. As Far from Land as Possible

排序

  1. ⭐⭐⭐⭐⭐PAT A1095 Cars on Campus
  2. ⭐PAT A1089 Insert or Merge

模拟

  1. ⭐PAT A1082 Read Number in Chinese
  2. ⭐⭐⭐⭐⭐PAT A1060 Are They Equal【变态测试数据】
  3. ⭐PAT A1061 Dating

贪心

  1. ⭐⭐⭐⭐⭐【贪心+巧用排序】PAT A1038 Recover the Smallest Number
  2. ⭐⭐⭐⭐⭐【贪心】PAT A1033 To Fill or Not to Fill
  3. ⭐⭐⭐⭐⭐【贪心】LeetCode 621. Task Scheduler