BFS, DFS 的题目总结.

Directed graph:

Directed Graph Loop detection and if not have, path to print all path.

BFS/DFS: (可以用BFS或者DFS的,主要还是遍历)

[LeetCode] 733. Flood Fill_Easy tag: BFS     1

[LeetCode] 690. Employee Importance_Easy tag: BFS    1

[LeetCode] 529. Minesweeper_ Medium_ tag: BFS

[LeetCode] 200. Number of Islands_ Medium tag: BFS

[LeetCode] 133. Clone Graph_ Medium tag: BFS, DFS

[LeetCode] 261. Graph Valid Tree _ Medium tag: BFS

[LeetCode] 301. Remove Invalid Parentheses_Hard tag:BFS

[LeetCode] 104. Maximum Depth of Binary Tree_Easy tag: DFS

[LeetCode] 827. Making A Large Island

[LeetCode] 695. Max Area of Island_Easy tag: DFS/BFS

[LeetCode] 490. The Maze_Medium tag: BFS/DFS

[LeetCode] 130. Surrounded Regions_Medium tag: DFS

BFS(shortest path/distance, level traversal)

[Leetcode] 863. All Nodes Distance K in Binary Tree_ Medium tag: BFS, Amazon     1

[LeetCode] 199. Binary Tree Right Side View_ Medium tag: BFS, Amazon

[LeetCode] 102. Binary Tree Level Order Traversal_Medium tag: BFS

[LeetCode] 127. Word Ladder _Medium tag: BFS

[LeetCode] 675. Cut Off Trees for Golf Event_Hard tag: BFS

[LeetCode] 103. Binary Tree Zigzag Level Order Traversal _ Medium tag: BFS

[LeetCode] 101. Symmetric Tree_ Easy tag: BFS

[LeetCode] 513. Find Bottom Left Tree Value_ Medium tag: BFS

[LeetCode] 286. Walls and Gates_Medium tag: BFS

[LeetCode] 116&117. Populating Next Right Pointers in Each Node I&II_Medium tag: BFS(Dont know why leetcode tag it as DFS...)

[LeetCode] 310. Minimum Height Trees_Medium tag: BFS

DFS

[LeetCode] 207 Course Schedule_Medium tag: BFS, DFS    1

[LeetCode] 785. Is Graph Bipartite?_Medium tag: DFS, BFS

[LeetCode] 210. Course Schedule II

[LeetCode] 694. Number of Distinct Islands

[LeetCode] 711. Number of Distinct Islands II_hard tag: DFS

[LeetCode] 851. Loud and Rich_ Medium tag: DFS

[LeetCode] 112. Path Sum_Easy tag: DFS

[LeetCode] 114. Flatten Binary Tree to Linked List_Medium tag: DFS

[LeetCode] 257. Binary Tree Paths_ Easy tag: DFS

[LeetCode] 113. Path Sum II

[LeetCode] 437. Path Sum III_ Easy tag: DFS

[LeetCode] 124. Binary Tree Maximum Path Sum_ Hard tag: DFS recursive

[LeetCode] 687. Longest Univalue Path_Easy tag: DFS recursive

[LeetCode] 298. Binary Tree Longest Consecutive Sequence_Medium tag: DFS recursive

[LeetCode] 549. Binary Tree Longest Consecutive Sequence II_ Medium tag: DFS recursive

[LeetCode] 721. Accounts Merge_Medium tag: DFS recursive

[LeetCode] 111. Minimum Depth of Binary Tree_Easy tag:DFS

[LeetCode] 110. Balanced Binary Tree_Easy tag: DFS

[LeetCode] 100. Same Tree_Easy tag: DFS

[LeetCode] 99. Recover Binary Search Tree

[LeetCode] 129. Sum Root to Leaf Numbers_Medium tag: DFS

[LeetCode] 559. Maximum Depth of N-ary Tree_Easy tag: DFS

[LeetCode] questions conclustion_BFS, DFS的更多相关文章

  1. All LeetCode Questions List 题目汇总

    All LeetCode Questions List(Part of Answers, still updating) 题目汇总及部分答案(持续更新中) Leetcode problems clas ...

  2. Summary: curated List of Top 75 LeetCode Questions to Save Your Time

    Facebook / Eng tech lead Dec 30, 2018  68 Comments   New Year Gift to every fellow time-constrained ...

  3. LeetCode Subsets (DFS)

    题意: 给一个集合,有n个互不相同的元素,求出所有的子集(包括空集,但是不能重复). 思路: DFS方法:由于集合中的元素是不可能出现相同的,所以不用解决相同的元素而导致重复统计. class Sol ...

  4. [LeetCode] questions conclusion_ Binary Search

    Binary Search T(n) = T(n/2) + O(1)   =>    T(n) = O(lg n) proof: 如果能用iterable , 就用while loop, 可以防 ...

  5. [LeetCode] questions conlusion_InOrder, PreOrder, PostOrder traversal

    Pre: node 先,                      Inorder:   node in,           Postorder:   node 最后 PreOrder Inorde ...

  6. [LeetCode] questions conclusion_ Dynamic Programming

    Questions: [LeetCode] 198. House Robber _Easy tag: Dynamic Programming [LeetCode] 221. Maximal Squar ...

  7. [LeetCode] questions conclustion_Path in Tree

    Path in Tree: [LeetCode] 112. Path Sum_Easy tag: DFS       input: root, target,   return True if exi ...

  8. Leetcode总结之DFS

    package DFS; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; impo ...

  9. LeetCode刷题 DFS+回溯

    一.DFS介绍 二.LeetCode 实战 LC 17. 电话号码的字母组合 解法思路 解题步骤 代码 LC 79. 单词搜索 解题思路 解题步骤 代码 LC 46. 全排列 解题思路一 解题步骤 代 ...

随机推荐

  1. spring基础---->spring自定义初始化(一)

    这里我们简单的实现一下spring中的初始化bean,以大概了解他的流程.受委屈几乎是一个人成长最快的途径,吃下去的是委屈,消化掉后得到的是格局. spring的自定义初始化 测试的项目结构如下: 一 ...

  2. 【linux系列】Centos下安装mysql数据库

    前言 为了测试方便,通常我们会自己安装数据库,以下是在Centos上安装Mysql的操作. 一.检查自己是否安装了MySQL数据库 [root@s201 /home/mysql]#rpm -qa |g ...

  3. C#网络编程TCP通信实例程序简单设计

    C#网络编程TCP通信实例程序简单设计 采用自带 TcpClient和TcpListener设计一个Tcp通信的例子 只实现了TCP通信 通信程序截图: 压力测试服务端截图: 俩个客户端链接服务端测试 ...

  4. Android 逆向工具

    逆向分析工具 https://github.com/skylot/jadx/ https://github.com/google/android-classyshark https://github. ...

  5. 使用virtualbox 配置 linux host-only虚拟主机连接外网(转载)

    host-only 下的虚拟机之间可以互相访问,虚拟机和宿主机可以互相访问,但是虚拟机不能访问外网. 需要设置: 1.宿主机设置 先对宿主机(windows机器,我这里是win7系统)进行相关配置. ...

  6. 查看JVM使用的默认的垃圾收集器

    一.查看步骤 cmd执行命令: java -XX:+PrintCommandLineFlags -version 输出如下(举例): 针对上述的-XX:UseParallelGC,这边我们引用< ...

  7. myisam innodb 次级 索引的区别

    MyISAM引擎使用B+Tree作为索引结构,叶节点的data域存放的是数据记录的地址.下图是MyISAM索引的原理图: 这里设表一共有三列,假设我们以Col1为主键,则上图是一个MyISAM表的主索 ...

  8. MySQL外键和高级查询(连接查询、联合查询、子查询、去重查询)

    MySQL的外键 什么是外键,很简单保持数据一致性的一个约束键.如果你有两张表,第一张是学生表,第二张表是一个成绩表,我们来看看保持数据一致性,其实在Django等框架的模型中中也能做关联获取对象. ...

  9. 替换Quartus 自带编辑器 (转COM张)

    正文 此处以Quartus II 11.1和Notepad++ v5.9.6.2为例. 1. 使用QII自动调用Notepad++来打开HDL.sdc.txt等文件:并且可以在报错的时候,Notepa ...

  10. python selenium操作表格式元素实例

    很多时候,网页上的布局都是表格形式的,如出下面这样的 这种网页类型在自动化中比较头痛,需要很多判断,下面就举个例子,这里以深圳出入境网页为例,http://yysl.sz3e.com/wsyysq/s ...