由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - MS面试题
相关主题
请教一道面试题,判断迷宫有没有解请教几个面试问题
问一道Apple电话面试题这个怎么做?
贡献A家面经问一道数据结构题
请问驿道面试题发Google面经,为明天MS攒rp
问一个老的google面试题问一个字符串面试问题
Find shortest substring that is only occurring once. in Given String(Medallia面试题)面试题请教:一个矩阵,里面的值是0或1,找出最大子矩阵,此子矩阵的值全为1
[合集] 一道 yahoo 面试题问一道data structure的面试题
请教一道题目请教道算法题
相关话题的讨论汇总
话题: tlb话题: cities话题: flight话题: write话题: city
进入JobHunting版参与讨论
1 (共1页)
b*********n
发帖数: 1258
1
Suppose there are n cities, and there may / may not be flight route
between c1 to c2. Design data structure to store this information and write
a function that receives two cities name, and return whether or not there is
a flight between them (either directly or through connections)
k*k
发帖数: 49
2
DP + Adjacent Matrix
for k = 1 to N //intermediate nodes
.....for a = 1 to N{
.........for b = 1 to N{
.............if (tlb[a][k] == 1 && tlb[k][b]==1){
................tlb[a][b] = 1;
..........}
.....}
}
bool isConnect(city a , city b)
..... return tlb[a][b];
construction time: O (N^3)
query time: O (1)
k***e
发帖数: 556
3
transitive closure problem
can use all sources shortest path algorithm to solve it

write
is

【在 b*********n 的大作中提到】
: Suppose there are n cities, and there may / may not be flight route
: between c1 to c2. Design data structure to store this information and write
: a function that receives two cities name, and return whether or not there is
: a flight between them (either directly or through connections)

H*****L
发帖数: 5705
4
any thought?
construct the trie such that all flights sharing >=1 common city belong to
one branch
input:AB,BC,DE
output: root - A-B-C
- B-C
- D-E
given city x,y, return substring(x,y)|substring(y,x)

write
is

【在 b*********n 的大作中提到】
: Suppose there are n cities, and there may / may not be flight route
: between c1 to c2. Design data structure to store this information and write
: a function that receives two cities name, and return whether or not there is
: a flight between them (either directly or through connections)

g*******y
发帖数: 1930
5
我觉得这个图问题,就是找连通components,可以用disjoint-set数据结构
1 (共1页)
进入JobHunting版参与讨论
相关主题
请教道算法题问一个老的google面试题
问个amazon面试题Find shortest substring that is only occurring once. in Given String(Medallia面试题)
请问一道google面试题[合集] 一道 yahoo 面试题
问几个phone screening的问题请教一道题目
请教一道面试题,判断迷宫有没有解请教几个面试问题
问一道Apple电话面试题这个怎么做?
贡献A家面经问一道数据结构题
请问驿道面试题发Google面经,为明天MS攒rp
相关话题的讨论汇总
话题: tlb话题: cities话题: flight话题: write话题: city