当前位置: 首页>后端>正文

面试算法突击

数组、链表

  1. https://leetcode.cn/problems/reverse-linked-list/
  2. https://leetcode.cn/problems/linked-list-cycle
  3. https://leetcode.cn/problems/swap-nodes-in-pairs
  4. https://leetcode.cn/problems/linked-list-cycle-ii
  5. https://leetcode.cn/problems/reverse-nodes-in-k-group/

堆栈、队列

  1. https://leetcode.cn/problems/implement-queue-using-stacks/solution/
  2. https://leetcode.cn/problems/implement-stack-using-queues/description/
  3. https://leetcode.cn/problems/valid-parentheses/description/

优先队列(PriorityQueue)

  1. https://leetcode.cn/problems/kth-largest-element-in-astream/discuss/149050/Java-Priority-Queue
  2. https://leetcode.cn/problems/sliding-window-maximum/

哈希表(HashTable)

  1. https://leetcode.cn/problems/valid-anagram/description/
  2. https://leetcode.cn/problems/two-sum/description/
  3. https://leetcode.cn/problems/3sum/description/
  4. https://leetcode.cn/problems/4sum/
  5. https://leetcode.cn/problems/group-anagrams/description/

树、二叉树、二叉搜索树

  1. https://leetcode.cn/problems/validate-binary-search-tree
  2. https://leetcode.cn/problems/lowest-common-ancestorof-a-binary-search-tree/
  3. https://leetcode.cn/problems/lowest-common-ancestorof-a-binary-tree/

二叉树遍历

  1. 前序(Pre-order):根-左-右
  2. 中序(In-order):左-根-右
  3. 后序(Post-order):左-右-根

分治、递归、回溯

  1. https://leetcode.cn/problems/powx-n/description/
  2. https://leetcode.cn/problems/majority-element/description/
  3. https://leetcode.cn/problems/maximum-subarray/description/
  4. https://leetcode.cn/problems/valid-anagram/#/description
  5. https://leetcode.cn/problems/find-all-anagrams-in-a-string/#/description
  6. https://leetcode.cn/problems/anagrams/#/description

贪心算法(Greedy Algorithm)

  1. https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-ii/description/
  2. https://leetcode.cn/problems/lemonade-change/description/
  3. https://leetcode.cn/problems/assign-cookies/description/
  4. https://leetcode.cn/problems/walking-robot-simulation/description/

深度优先DFS+广度优先BFS

  1. https://leetcode.cn/problems/binary-tree-level-order-traversal/
  2. https://leetcode.cn/problems/maximum-depth-of-binary-tree/
  3. https://leetcode.cn/problems/minimum-depth-of-binary-tree/description/
  4. https://leetcode.cn/problems/generate-parentheses/

剪枝

  1. https://leetcode.cn/problems/n-queens/
  2. https://leetcode.cn/problems/n-queens-ii/
  3. https://leetcode.cn/problems/valid-sudoku/description/
  4. https://leetcode.cn/problems/sudoku-solver/#/description

二分查找

  1. https://leetcode.cn/problems/sqrtx/
  2. https://leetcode.cn/problems/valid-perfect-square/
  3. https://www.beyond3d.com/content/articles/8/

字典树

  1. https://leetcode.cn/problems/implement-trie-prefix-tree/#/description
  2. https://leetcode.cn/problems/word-search-ii/

位运算

  1. https://leetcode.cn/problems/number-of-1-bits/
  2. https://leetcode.cn/problems/power-of-two/
  3. https://leetcode.cn/problems/counting-bits/description/
  4. https://leetcode.cn/problems/n-queens-ii/description/

动态规划

  1. https://leetcode.cn/problems/climbing-stairs/description/
  2. https://leetcode.cn/problems/triangle/description/
  3. https://leetcode.cn/problems/maximum-product-subarray/description/
  4. https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/#/description
  5. https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-ii/
  6. https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-iii/
  7. https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-iv/
  8. https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-with-cooldown/
  9. https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
  10. https://leetcode.cn/problems/longest-increasing-subsequence
  11. https://leetcode.cn/problems/coin-change/
  12. https://leetcode.cn/problems/edit-distance/

并查集

  1. https://leetcode.cn/problems/number-of-islands/
  2. https://leetcode.cn/problems/friend-circles/

LRU Cache

  1. https://leetcode.cn/problems/lru-cache/#/

https://www.xamrdz.com/backend/3nd1940039.html

相关文章: