LeetCode 题目总结/分类

利用堆栈:

http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/

http://oj.leetcode.com/problems/longest-valid-parentheses/ (也可以用一维数组,贪心)

http://oj.leetcode.com/problems/valid-parentheses/

http://oj.leetcode.com/problems/largest-rectangle-in-histogram/

特别注意细节:http://oj.leetcode.com/problems/trapping-rain-water/



多种数据结构:

http://oj.leetcode.com/problems/lru-cache/

http://oj.leetcode.com/problems/substring-with-concatenation-of-all-words/
(注意遍历方法)

HASH:http://oj.leetcode.com/problems/longest-consecutive-sequence/



简单编程:

http://oj.leetcode.com/problems/longest-common-prefix/

http://oj.leetcode.com/problems/string-to-integer-atoi/ (分析,控制语句)



排序 & 查找:

二分查找:http://oj.leetcode.com/problems/search-a-2d-matrix/

二分查找进阶:http://oj.leetcode.com/problems/search-for-a-range/

二分查找应用:http://oj.leetcode.com/problems/sqrtx/

二分查找应用:http://oj.leetcode.com/problems/search-insert-position/

二分查找变种:http://oj.leetcode.com/problems/search-in-rotated-sorted-array/

二分查找变种:http://oj.leetcode.com/problems/search-in-rotated-sorted-array-ii/



简单数学:

http://oj.leetcode.com/problems/pascals-triangle/

http://oj.leetcode.com/problems/pascals-triangle-ii/

http://oj.leetcode.com/problems/powx-n/

http://oj.leetcode.com/problems/reverse-integer/

http://oj.leetcode.com/problems/plus-one/

http://oj.leetcode.com/problems/unique-paths/

http://oj.leetcode.com/problems/palindrome-number/

http://oj.leetcode.com/problems/permutation-sequence/

http://oj.leetcode.com/problems/merge-intervals/

http://oj.leetcode.com/problems/valid-number/

http://oj.leetcode.com/problems/climbing-stairs/

http://oj.leetcode.com/problems/roman-to-integer/

http://oj.leetcode.com/problems/integer-to-roman/

http://oj.leetcode.com/problems/divide-two-integers/

区间:http://oj.leetcode.com/problems/insert-interval/



大数的数学运算:

http://oj.leetcode.com/problems/add-binary/

http://oj.leetcode.com/problems/add-two-numbers/



数组:

http://oj.leetcode.com/problems/remove-element/

http://oj.leetcode.com/problems/merge-sorted-array/

http://oj.leetcode.com/problems/first-missing-positive/

http://oj.leetcode.com/problems/spiral-matrix/

http://oj.leetcode.com/problems/spiral-matrix-ii/

http://oj.leetcode.com/problems/rotate-image/

遍历技巧:http://oj.leetcode.com/problems/container-with-most-water/

http://oj.leetcode.com/problems/two-sum/

http://oj.leetcode.com/problems/3sum/

http://oj.leetcode.com/problems/3sum-closest/

http://oj.leetcode.com/problems/4sum/

http://oj.leetcode.com/problems/set-matrix-zeroes/

用好标记数组:http://oj.leetcode.com/problems/valid-sudoku/

http://oj.leetcode.com/problems/next-permutation/

http://oj.leetcode.com/problems/word-search/

http://oj.leetcode.com/problems/remove-duplicates-from-sorted-array/

http://oj.leetcode.com/problems/remove-duplicates-from-sorted-array-ii/

http://oj.leetcode.com/problems/sort-colors/



暴力方法/细节实现:

http://oj.leetcode.com/problems/max-points-on-a-line/



链表:

归并排序:http://oj.leetcode.com/problems/sort-list/

插入排序:http://oj.leetcode.com/problems/insertion-sort-list/

反转、插入:http://oj.leetcode.com/problems/reorder-list/

检测是否有环:http://oj.leetcode.com/problems/linked-list-cycle/

确定链表环的起点:http://oj.leetcode.com/problems/linked-list-cycle-ii/

Deep Copy 带有随机指针的链表:http://oj.leetcode.com/problems/copy-list-with-random-pointer/

链表细节:http://oj.leetcode.com/problems/rotate-list/

http://oj.leetcode.com/problems/remove-duplicates-from-sorted-list/

删除细节:http://oj.leetcode.com/problems/remove-duplicates-from-sorted-list-ii/

http://oj.leetcode.com/problems/partition-list/

http://oj.leetcode.com/problems/swap-nodes-in-pairs/

Merge 两个链表:http://oj.leetcode.com/problems/merge-two-sorted-lists/

Merge 多链表:http://oj.leetcode.com/problems/merge-k-sorted-lists/

细节:http://oj.leetcode.com/problems/reverse-nodes-in-k-group/

http://oj.leetcode.com/problems/remove-nth-node-from-end-of-list/

http://oj.leetcode.com/problems/reverse-linked-list-ii/



二叉树遍历:递归 & 非递归

http://oj.leetcode.com/problems/same-tree/

前序:http://oj.leetcode.com/problems/binary-tree-preorder-traversal/

中序:http://oj.leetcode.com/problems/binary-tree-inorder-traversal/

后序:http://oj.leetcode.com/problems/binary-tree-postorder-traversal/

遍历变种:http://oj.leetcode.com/problems/sum-root-to-leaf-numbers/

遍历变种:http://oj.leetcode.com/problems/path-sum/

遍历变种:http://oj.leetcode.com/problems/path-sum-ii/

遍历变种:http://oj.leetcode.com/problems/maximum-depth-of-binary-tree/

遍历变种:http://oj.leetcode.com/problems/minimum-depth-of-binary-tree/

重建二叉树:http://oj.leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/

重建二叉树:http://oj.leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/

层次遍历变种:http://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/

遍历变种:http://oj.leetcode.com/problems/symmetric-tree/

遍历应用:http://oj.leetcode.com/problems/binary-tree-maximum-path-sum/

遍历应用:http://oj.leetcode.com/problems/balanced-binary-tree/

遍历应用:http://oj.leetcode.com/problems/recover-binary-search-tree/

遍历应用:http://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/

level遍历:http://oj.leetcode.com/problems/binary-tree-level-order-traversal/

level 遍历:http://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/

level 遍历变种:http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/

level 遍历变种:http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/



问题分析/智商/细节:

http://oj.leetcode.com/problems/single-number/

http://oj.leetcode.com/problems/single-number-ii/

http://oj.leetcode.com/problems/candy/

http://oj.leetcode.com/problems/gas-station/



动态规划:

http://oj.leetcode.com/problems/triangle/ (最短路径)

http://oj.leetcode.com/problems/subsets/ (另一种形式)

http://oj.leetcode.com/problems/subsets-ii/

http://oj.leetcode.com/problems/edit-distance/ (经典)

http://oj.leetcode.com/problems/word-break/

http://oj.leetcode.com/problems/word-break-ii/

http://oj.leetcode.com/problems/unique-binary-search-trees/ (动态规划避免递归)

http://oj.leetcode.com/problems/unique-paths-ii/

http://oj.leetcode.com/problems/scramble-string/

http://oj.leetcode.com/problems/palindrome-partitioning/

http://oj.leetcode.com/problems/palindrome-partitioning-ii/

http://oj.leetcode.com/problems/interleaving-string/

http://oj.leetcode.com/problems/distinct-subsequences/

http://oj.leetcode.com/problems/decode-ways/

http://oj.leetcode.com/problems/gray-code/

http://oj.leetcode.com/problems/minimum-path-sum/



回溯:

http://oj.leetcode.com/problems/combinations/

http://oj.leetcode.com/problems/generate-parentheses/

http://oj.leetcode.com/problems/combination-sum/

http://oj.leetcode.com/problems/combination-sum-ii/

http://oj.leetcode.com/problems/sudoku-solver/

经典N皇后:http://oj.leetcode.com/problems/n-queens/

http://oj.leetcode.com/problems/n-queens-ii/

http://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/



贪心:

http://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock/

http://oj.leetcode.com/problems/jump-game/

http://oj.leetcode.com/problems/jump-game-ii/

http://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/

http://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/

http://oj.leetcode.com/problems/maximum-subarray/

http://oj.leetcode.com/problems/minimum-window-substring/

http://oj.leetcode.com/problems/maximal-rectangle/

http://oj.leetcode.com/problems/longest-substring-without-repeating-characters/



分治 & 递归:

http://oj.leetcode.com/problems/unique-binary-search-trees-ii/

http://oj.leetcode.com/problems/restore-ip-addresses/ (时间复杂度有限,递归满足)

http://oj.leetcode.com/problems/permutations/

http://oj.leetcode.com/problems/permutations-ii/

http://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/

http://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/

http://oj.leetcode.com/problems/median-of-two-sorted-arrays/

http://oj.leetcode.com/problems/validate-binary-search-tree/



字符串:

http://oj.leetcode.com/problems/count-and-say/

http://oj.leetcode.com/problems/implement-strstr/ (子串查找)

http://oj.leetcode.com/problems/anagrams/

http://oj.leetcode.com/problems/text-justification/ (细节)

http://oj.leetcode.com/problems/simplify-path/ (基础控制语句 if-else-for)

http://oj.leetcode.com/problems/multiply-strings/

http://oj.leetcode.com/problems/regular-expression-matching/

http://oj.leetcode.com/problems/wildcard-matching/

http://oj.leetcode.com/problems/longest-palindromic-substring/

http://oj.leetcode.com/problems/zigzag-conversion/

http://oj.leetcode.com/problems/length-of-last-word/

http://oj.leetcode.com/problems/valid-palindrome/



图:

深搜/广搜:http://oj.leetcode.com/problems/clone-graph/



搜索 & 遍历:

http://oj.leetcode.com/problems/word-ladder/

http://oj.leetcode.com/problems/word-ladder-ii/

广搜:http://oj.leetcode.com/problems/surrounded-regions/

LeetCode 题目总结/分类的更多相关文章

  1. <转>LeetCode 题目总结/分类

    原链接:http://blog.csdn.net/yangliuy/article/details/44514495 注:此分类仅供大概参考,没有精雕细琢.有不同意见欢迎评论~ 利用堆栈:http:/ ...

  2. 【转载】LeetCode 题目总结/分类

    引自:http://www.douban.com/note/330562764/ 注:此分类仅供大概参考,没有精雕细琢.有不同意见欢迎评论~ 利用堆栈:http://oj.leetcode.com/p ...

  3. LeetCode题目解答

    LeetCode题目解答——Easy部分 Posted on 2014 年 11 月 3 日 by 四火 [Updated on 9/22/2017] 如今回头看来,里面很多做法都不是最佳的,有的从复 ...

  4. LeetCode:颜色分类【75】

    LeetCode:颜色分类[75] 题目描述 给定一个包含红色.白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色.白色.蓝色顺序排列. 此题中,我们使用整数 ...

  5. leetcode题目清单

    2016-09-24,开始刷leetcode上的算法题,下面整理一下leetcode题目清单.Github-leetcode 1.基本数学 Two Sum Palindrome Number Cont ...

  6. Binary Search Tree 以及一道 LeetCode 题目

    一道LeetCode题目 今天刷一道LeetCode的题目,要求是这样的: Given a binary search tree and the lowest and highest boundari ...

  7. Leetcode题目practice

    目录 Leetcode题目解答 1. 删除最外层的括号 2. 两数之和 3. 宝石与石头 4. 移除元素 5.删除排序数组中的重复项 6.寻找两个有序数组的中位数 7.盛最多水的容器 8.存在重复元素 ...

  8. LeetCode题目总结-滑窗法

    LeetCode题目总结-滑动窗口法 滑动窗口法:此方法首先建立一个长度为零的窗口,把右侧窗口向右移动,当新的元素与原来窗口中的元素不重复时,把新的元素加入其中,并更新窗口长度:当新的元素与原集合中的 ...

  9. Leetcode题目分类整理

    一.数组 8) 双指针 ---- 滑动窗口 例题: 3. Longest Substring Without Repeating Characters 描述:Given a string, find ...

随机推荐

  1. 【bzoj1057】棋盘制作

    题意 给定\(n*m\)的棋盘,每个格子有0或1其中的一种颜色. 求一个最大的正方形,满足正方形内0和1相互间隔. 求一个最大的矩形,满足矩形内0和1相互间隔. \(n,m\leq 2000\) 分析 ...

  2. ruby中的reject和reject!

    reject和reject!reject返回不满足代码块的元素数组reject!删除数组中满足代码块的元素 a=[1,2,3,5]a.reject! {|x| x<4}p a #[5] b = ...

  3. jdk集合常用方法分析之HashSet和TreeSet

    HashSet常用方法介绍 public boolean add(E e) public boolean isEmpty() void clear() public Iterator<E> ...

  4. 网站性能扩展案例:每天30-50亿请求,300K QPS是如何炼成的

    Reduce Data广告服务网站(http://reducedata.com)如何扩展到每天300K QPS请求?分享经验如下: 1. 为大规模而设计,广告服务平台从一开始增长就很惊人,因此,系统开 ...

  5. tomcat 安全文件夹(Java之负基础实战)

    tomcat 解析网站的时候,会寻找一个文件叫  WEB-INF 这些文件外部无法访问

  6. eclipse中以debug方式启动tomcat报错

    在eclipse中debug  Tomcat报错,错误如下: FATAL ERROR in native method: JDWP No transports initialized, jvmtiEr ...

  7. mysql--实现oracle的row_number() over功能

    有时候我们想要得到每个分组的前几条记录,这个时候oracle中row_number函数使用非常方便,但可惜mysql没有.网上搜了些实现方法. 表flow_task有phaseno(序列号),obje ...

  8. C 线性表的链式存储实现及插入、删除等操作示例

    一.链式存储的优势 线性表的存储可以通过顺序存储或链式存储实现,其中顺序存储基于数组实现(见本人上一篇博客),在进行插入删除等操作时,需对表内某一部分元素逐个移动,效率较低.而链式结构不依赖于地址连续 ...

  9. Linux&amp;Windows中VNC协议及使用方法

    [转载]window下使用vnc远程登录ubuntu/linux图形界面_五个粽子_新浪博客http://blog.sina.com.cn/s/blog_677265f601012mqg.html V ...

  10. Zabbix4.0添加端口和进程监控

    一:Zabbix设置主动模式: vim /etc/zabbix/zabbix_agent.conf Server=192.168.1.10 #被动模式的serverip地址,如果设置纯被动模式,可以注 ...