一亩三分地论坛

 找回密码
 获取更多干货,去instant注册!

扫码关注一亩三分地公众号
查看: 969|回复: 3
收起左侧

[算法题] 问一道Google面试题

[复制链接] |试试Instant~ |关注本帖
Sendoh2015 发表于 2016-3-19 14:10:33 | 显示全部楼层 |阅读模式

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看,没有帐号?获取更多干货,去instant注册!

x
最近这几天在整理之前收集的Google的面经,看到这题考到过2次,但是不知道怎么做。谁能给讲讲?谢谢啊


A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties.

There is exactly one node, called the root, to which no directed edges point.Every node except the root has exactly one edge pointing to it.There is a unique sequence of directed edges from the root to each node.
For example, consider the illustrations below, in which nodes are represented by circles and edges are represented by lines with arrowheads. The first two of these are trees, but the last is not.


wtcupup 发表于 2016-3-19 14:38:23 | 显示全部楼层
本帖最后由 wtcupup 于 2016-3-19 14:42 编辑

https://leetcode.com/problems/graph-valid-tree/

评分

1

查看全部评分

回复 支持 反对

使用道具 举报

 楼主| Sendoh2015 发表于 2016-3-20 15:21:00 | 显示全部楼层
wtcupup 发表于 2016-3-19 14:38
https://leetcode.com/problems/graph-valid-tree/

原来是这题,我锁着的没刷,看来还是买个包年算了。谢谢啊
回复 支持 反对

使用道具 举报

qiuxuxing007 发表于 2016-11-7 04:39:22 | 显示全部楼层
这道题目和lc不同的一点是, 这道题目是有向图, 而lc里面是无向图
回复 支持 反对

使用道具 举报

本版积分规则

请点这里访问我们的新网站:一亩三分地Instant.

Instant搜索更强大,不扣积分,内容组织的更好更整洁!目前仍在beta版本,努力完善中!反馈请点这里

关闭

一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明 ( 沪ICP备11015994号 )

custom counter

GMT+8, 2016-12-4 19:04

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

快速回复 返回顶部 返回列表