- 博客(4)
- 收藏
- 关注
原创 445. Add Two Numbers II 两个数字相加 2
一、题目解释 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers
2017-12-07 20:37:59 139
转载 543. Diameter of Binary Tree 二叉树的直径
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longestpath between any two nodes in a tree. This path may or may no
2017-12-07 16:13:09 155
原创 112. Path Sum
一、题目描述 Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Given the below binary tree
2017-12-07 14:51:08 112
原创 DFS
一、DFS介绍 深度优先搜索算法(英语:Depth-First-Search,简称DFS)是一种用于遍历或搜索树或图的算法。沿着树的深度遍历树的节点,尽可能深的搜索树的分支。当节点v的所在边都己被探寻过,搜索将回溯到发现节点v的那条边的起始节点。这一过程一直进行到已发现从源节点可达的所有节点为止。如果还存在未被发现的节点,则选择其中一个作为源节点并重复以上过程,整个进程反复进行直
2017-12-07 12:56:41 1545 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人