- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 【LeetCode】200. Number of Islands
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume...
2018-09-30 22:31:27 142
原创 【LeetCode】827. Making A Large Island
In a 2D grid of 0s and 1s, we change at most one 0 to a 1.After, what is the size of the largest island? (An island is a 4-directionally connected group of 1s).Example 1:Input: [[1, 0], [0, 1]]...
2018-09-30 22:28:23 178
原创 【LeetCode】332. Reconstruct Itinerary
Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong to a man who departs from JFK. Thus, th...
2018-09-10 14:26:54 143
原创 【LeetCode】210. Course Schedule II
There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair...
2018-09-08 23:27:37 158
原创 【LeetCode】207. Course Schedule
There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair...
2018-09-07 13:09:55 116
转载 判断有向图是否存在环
简介 前面讨论的很多文章里,都是针对无向图进行的分析。无向图的一个特性就是其中一旦两个节点a和b是相连的,这就意味着有路径从a到b,同时也有从b到a的。它具体对应的矩阵表达方式对应着一个对称矩阵。而这里重点是考察有向图。和无向图比起来,有向图更加多了一种出入度的概念。因为方向的有向性,很多以前在无向图里看起来比较简单的问题在这里会变得更加有意思。 有向图定义 一个常用的有向...
2018-09-04 22:36:43 20700
原创 【Leetcode】743. Network Delay Time
There are N network nodes, labelled 1 to N.Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v is the target node, and w is the time it takes fo...
2018-09-04 15:02:25 114
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人