
DFS
文章平均质量分 83
iyangdi
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Google算法题:仓鼠血缘
题目 如何找到两只仓鼠的血缘关系。没有预定义任何数据结构,只是让你写一个函数来做。有能力对问题进行建模,然后快速而高质量地编码 分析 (1)构造血缘图 (2)运用dfs,看能不能找到从仓鼠a到仓鼠b的路径,有则说明有血缘,无则说明无血缘 代码 package com.graph; import java.util.*; public cl原创 2017-08-07 22:23:50 · 742 阅读 · 0 评论 -
LeetCode Graph:M332. 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原创 2017-08-05 15:47:13 · 272 阅读 · 0 评论 -
LeetCode Graph:M399. Evaluate Division
Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the answ原创 2017-08-05 18:50:10 · 317 阅读 · 0 评论 -
LintCode:M-Palindrome Partitioning
LintCode:Link Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Have you met this question in a r原创 2017-08-24 23:09:02 · 212 阅读 · 0 评论 -
LeetCode:M-200. Number of Islands
LeetCode链接 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 vert原创 2017-09-13 11:25:09 · 277 阅读 · 0 评论