面试算法突击

字符串

  1. 无重复字符的最长子串 https://leetcode.cn/problems/longest-substring-without-repeating-characters/
    49.字母异位词分组 https://leetcode.cn/problems/group-anagrams/
    30.串联所有单词的子串 https://leetcode.cn/problems/substring-with-concatenation-of-all-words/

线性表

  1. 分隔链表 https://leetcode-cn.com/problems/partition-list/
  2. 最接近的三数之和 https://leetcode-cn.com/problems/3sum-closest/
  3. 移除元素 https://leetcode-cn.com/problems/remove-element/
  4. 我的日程安排表 III https://leetcode-cn.com/problems/my-calendar-iii/

数组、链表

  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. 环形链表 II https://leetcode.cn/problems/linked-list-cycle-ii
  5. K个一组翻转链表 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/

队列

  1. 设计循环双端队列 https://leetcode-cn.com/problems/design-circular-deque/
  2. 根据身高重建队列 https://leetcode-cn.com/problems/queue-reconstruction-by-height/
  3. 有序队列 https://leetcode-cn.com/problems/orderly-queue/

堆栈

  1. 验证栈序列 https://leetcode.cn/problems/validate-stack-sequences/
  2. 最大频率栈 https://leetcode.cn/problems/maximum-frequency-stack/
  3. 填充每个节点的下一个右侧节点指针 II https://leetcode.cn/problems/populating-next-right-pointers-in-each-node-ii/
  4. 最大频率栈 https://leetcode.cn/problems/maximum-frequency-stack/

优先队列(PriorityQueue)

  1. 数据流中的第 K 大元素 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/
  6. 旋转链表 https://leetcode.cn/problems/rotate-list/
  7. 我的日程安排表 I https://leetcode.cn/problems/my-calendar-i/
  8. K个一组翻转链表 https://leetcode.cn/problems/reverse-nodes-in-k-group
  9. 砖墙 https://leetcode.cn/problems/brick-wall/

树、二叉树、二叉搜索树

  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):根-左-右 https://leetcode.cn/problems/binary-tree-preorder-traversal/
  2. 中序(In-order):左-根-右 https://leetcode.cn/problems/binary-tree-inorder-traversal/
  3. 后序(Post-order):左-右-根 https://leetcode.cn/problems/binary-tree-postorder-traversal/

分治、递归、回溯

  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/#/

深度优先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/

DFS:

  1. 统计封闭岛屿的数目 https://leetcode.cn/problems/number-of-closed-islands/
  2. 从前序与中序遍历序列构造二叉树 https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/
  3. 路径总和 https://leetcode.cn/problems/path-sum/
  4. 验证二叉搜索树 https://leetcode.cn/problems/validate-binary-search-tree/
  5. 目标和 https://leetcode.cn/problems/target-sum/
  6. 省份数量 https://leetcode.cn/problems/number-of-provinces/

BFS:

  1. 二进制矩阵中的最短路径 https://leetcode.cn/problems/shortest-path-in-binary-matrix/
  2. 颜色交替的最短路径 https://leetcode.cn/problems/shortest-path-with-alternating-colors/
  3. 二叉树的层序遍历 https://leetcode.cn/problems/binary-tree-level-order-traversal/
  4. 对称二叉树 https://leetcode.cn/problems/symmetric-tree/
  5. 打开转盘锁 https://leetcode.cn/problems/open-the-lock/
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 204,293评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,604评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,958评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,729评论 1 277
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,719评论 5 366
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,630评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,000评论 3 397
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,665评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,909评论 1 299
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,646评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,726评论 1 330
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,400评论 4 321
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,986评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,959评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,197评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 44,996评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,481评论 2 342

推荐阅读更多精彩内容