Redian新闻
>
这里就没有升级IOS9后没法在itune里面备份app的吗?
avatar
这里就没有升级IOS9后没法在itune里面备份app的吗?# Apple - 家有苹果
s*g
1
刚开始找工作,面试了几家,好几次被问到了这道题,想来应该是经典题了,可是搜了
一下,没发现很直接的答案,所以想请教大家。
题目是:
有一个不定长的char string (S1),都是0,1组成;另外一个string (S2), 也是0,1
组成,可以认为是pattern,问S1中是否含有S2
e.g S1 = 11100011 10101011 11111111 10000100 ( 4 bytes, '11100011' is 1 byte)
S2 = 00111010
the answer is ture, 1110"00111010"1011
希望讲清楚了,先谢谢了
avatar
O*n
2
咔嚓后第三天。
avatar
qr
3
有什么可以破解的办法?
avatar
j*u
4
没看懂。
为什么表示成bit?这个难道不就是普通的substring match吗?
avatar
O*n
5


【在 O**********n 的大作中提到】
: 咔嚓后第三天。
avatar
x*q
6
现在大部分都是icloud备份了吧?

【在 qr 的大作中提到】
: 有什么可以破解的办法?
avatar
g*s
7
special string, should be some trick of bit manipulation?

【在 j*****u 的大作中提到】
: 没看懂。
: 为什么表示成bit?这个难道不就是普通的substring match吗?

avatar
N*E
8
麦克斯的精神看起来还不错
avatar
t*d
9
can you just do right shift S1 32 times and check bitwise and with 11111111
and the one of the result should equal s2 if the patten is contained in S1.
assume s2 is already 1 byte.
avatar
m*j
10
爷爷奶奶没给专门做点病号饭?
avatar
b*n
11
didn't notice it's char string not binary bits,
slide a window of len(S2) over S1, and the value of the window
can be calculated at first, then silde the window one char at a time,
the new value will be the old valude << 1 + new added char (constant time)
compare the value of the window with valude of S2
O(n)

1
byte)

【在 s******g 的大作中提到】
: 刚开始找工作,面试了几家,好几次被问到了这道题,想来应该是经典题了,可是搜了
: 一下,没发现很直接的答案,所以想请教大家。
: 题目是:
: 有一个不定长的char string (S1),都是0,1组成;另外一个string (S2), 也是0,1
: 组成,可以认为是pattern,问S1中是否含有S2
: e.g S1 = 11100011 10101011 11111111 10000100 ( 4 bytes, '11100011' is 1 byte)
: S2 = 00111010
: the answer is ture, 1110"00111010"1011
: 希望讲清楚了,先谢谢了

avatar
p*y
12
这个红红的毛色真好看!
avatar
g*x
13
build suffix tree of S1, check if S2 contains in the suffix tree, this
should take O(n)
avatar
Z*i
14
小麦颜色真红阿
avatar
b*s
15
O(n)的办法给你一个
就你这个例子是先换成int和char存储,然后把int分别>>1一共31次,每次shift之前都拿低八位
和char比较,相等即存在
avatar
s*n
16
好帅啊!!!
avatar
Y*Y
18
还是这么帅阿
avatar
x*o
20
WOW
红色的!
好漂亮啊!!
avatar
f*s
21
这个鸭子我在沃尔玛看过~~~~哈哈~!

【在 O**********n 的大作中提到】
: 咔嚓后第三天。
avatar
O*n
22
爷爷上月去世啦!小麦郁闷了好一段时间,现在每天缠着奶奶,已经开始挑食啦,又被
宠坏啦!

【在 m***j 的大作中提到】
: 爷爷奶奶没给专门做点病号饭?
avatar
m*j
23
i am sorry

【在 O**********n 的大作中提到】
: 爷爷上月去世啦!小麦郁闷了好一段时间,现在每天缠着奶奶,已经开始挑食啦,又被
: 宠坏啦!

avatar
O*n
24
that is ok,小麦四天没吃饭,葬礼的时候我把他带到墓地啦,从来不叫的他,在车里
好一顿号。

【在 m***j 的大作中提到】
: i am sorry
avatar
Y*Y
25
心碎了。
i am so sorry for your loss.

【在 O**********n 的大作中提到】
: that is ok,小麦四天没吃饭,葬礼的时候我把他带到墓地啦,从来不叫的他,在车里
: 好一顿号。

avatar
s*M
26
sorry to hear that。。。
不过max tan的可真标志阿!
我周围很少见着颜色的金毛呢
avatar
j*e
27
Sorry for your loss.
赞懂事的小金麦
avatar
s*r
28
cft...

【在 O**********n 的大作中提到】
: 爷爷上月去世啦!小麦郁闷了好一段时间,现在每天缠着奶奶,已经开始挑食啦,又被
: 宠坏啦!

avatar
x*u
29
为什么我觉得像印度金毛,哈哈哈
avatar
x*u
30
pat pat

【在 O**********n 的大作中提到】
: that is ok,小麦四天没吃饭,葬礼的时候我把他带到墓地啦,从来不叫的他,在车里
: 好一顿号。

avatar
i*p
31
小麦真懂事
avatar
t*u
32
帅麦麦!
祝福爷爷走好。
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。