Find the number Weak Connected Component in the directed graph. Each node in the graph contains a label and a list of its neighbors. (a weak connected ...
分类:
其他好文 时间:
2017-11-12 11:13:28
阅读次数:
170
Given n nodes in a graph labeled from 1 to n. There is no edges in the graph at beginning. You need to support the following method:1. connect(a, b), ...
分类:
其他好文 时间:
2017-11-12 11:12:50
阅读次数:
124
Count how many 1 in binary representation of a 32-bit integer. Count how many 1 in binary representation of a 32-bit integer. Count how many 1 in bina ...
分类:
其他好文 时间:
2017-11-12 11:10:12
阅读次数:
138
Follow up for "Unique Paths": Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space ...
分类:
其他好文 时间:
2017-11-12 11:08:24
阅读次数:
216
Using O(1) time to check whether an integer n is a power of 2. Using O(1) time to check whether an integer n is a power of 2. Using O(1) time to check ...
分类:
其他好文 时间:
2017-11-12 11:06:44
阅读次数:
139
Given n nodes in a graph labeled from 1 to n. There is no edges in the graph at beginning. You need to support the following method:1. connect(a, b), ...
分类:
其他好文 时间:
2017-11-12 11:04:38
阅读次数:
131
Bit Rotation -—— A rotation (or circular shift) is an operation similar to shift except that the bits that fall off at one end are put back to the oth ...
分类:
其他好文 时间:
2017-11-12 11:02:35
阅读次数:
147
Find the number connected component in the undirected graph. Each node in the graph contains a label and a list of its neighbors. (a connected compone ...
分类:
其他好文 时间:
2017-11-11 14:15:50
阅读次数:
212
Deep clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. How we serialize an undirected graph: Nodes are l ...
分类:
其他好文 时间:
2017-11-11 11:42:31
阅读次数:
161
Six degrees of separation is the theory that everyone and everything is six or fewer steps away, by way of introduction, from any other person in the ...
分类:
其他好文 时间:
2017-11-11 11:17:15
阅读次数:
150