由买买提看人间百态

topics

全部话题 - 话题: shuffling
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
m**q
发帖数: 189
1
来自主题: JobHunting版 - G家电面题,求解答‏
我觉得第二个主要是文件无法直接shuffle,得分块后把每一块load到内存
的数组中,然后在数组中随机shuffle后输出。
没搞明白的是如何证明随机merge这样shuffle后的文件块能产生完全随机的结果呢?

IsNumberTaken(
j*****n
发帖数: 1545
2
我被问过这个题:
1.给了一段没注释得代码,分析是干么得。
2.最后看出来是个 shuffle, 而且很苦逼的不是perfect shuffle
3.问怎么improve这个苦逼的non-perfect shuffle 的效率, 依旧让他non-perfect.
4.怎么从practice 来验证是non-perfect. 我就说run他个一夜,分析每个
permutation的出现频率之类的。 他就说不好,permutation是exponential的,需要验
证的太多了。就被拒了。
s*****n
发帖数: 5488
3
这题虽然忘了解法,不过顺着当年依稀的记忆写个不是0(n^2)的算法吧。
int shuffle(int[] arr, int n){
assert(n%2 == 0);
if (n <=2)
return;
for (int i = n/4; i < n/2; i--)
swap(arr, i, i + n/2);
shuffle(arr,0, n/2);
shuffle (arr, n/2, n);
}
a******t
发帖数: 2944
4
Since you are new to this, here is a warning:
when shuffling snow, be careful:
- many people die from heart attacks shuffling snow
because the cold weather contracts the blood vessels and
people don't think of shuffling as physically taxing. Get
warmed up first, just like before exercising.
- many people slip and hurt themselves. wear shoes/boots
with rubber soles.
- keep an eye out on vehicular traffic in the street and wear
brightly colored clothing, don't get run over by a skidding
b*********a
发帖数: 1145
5
来自主题: Running版 - 四元素缺一不可
我跑高高低低的路面大半年了,还没跑死,膝盖也没伤,而且由于路面不好要小心保持
平衡减轻缓冲,居然被迫练成了shuffling神功,呵呵,当然俺是慢慢shuffle,感觉这
个真的对防止受伤很好,我跑全马就是那么跑,一点都不累,当然我pace 目标定得低
,10分的可以shuffle,9分也行,8分就不成了,当然8分我连10K都跑不了
赛,我真罗嗦。。。
L***0
发帖数: 1283
6
Heading back from Twin Lakes, there were immediately a few miles' steep
climb. I walked up just like everybody else. The walking continued for a
couple miles, and I wasn't feeling well. Somehow I seemed to have been
drained of energy. I felt dizzy and nauseated, my legs felt weak, and I was
wobbling as I hiked up the dirt trail. I had a pro bar in my camelbak but I
could not make myself eat it. I couldn't stomach anything. It became
difficult to run even on the flat sections. It was getting dark... 阅读全帖
d*g
发帖数: 16592
7
来自主题: Tennis版 - 步法,还是步法
上周和教练讨论步法,他建议我用side shuffle从准备地方到击球点移动,我觉得肯定
是错的,我说我回去研究一下,然后告诉他结果,昨天早上给他发,晚上team
practice之后见到他,和他还有中心的director一起研究了一下,最后结论认为比较正
确的是第一个Bollettieri academy的那个,当然不同situation可能不能一概而论。
==================================================================
I did some research through youtube. I looked at the different kinds
of clips. I found the one that mention the quickest way to run to the
contact point from ready position is not side shuffling, and instead
is run the first step with the foot of oppos... 阅读全帖
n*w
发帖数: 3393
8
来自主题: WaterWorld版 - 从美国流行音乐看西方文化之堕落
看了一下这个孩子的tutorial,感觉比较磨鞋子。
http://www.youtube.com/watch?v=3Zbh4bMK3PQ
未名空间什么时候举办shuffle dance比赛?我想报名参加。
又看了一遍聚会摇滚颂歌,连最开始那个穿紧身裤的大肚子都跳的超赞的,我喜欢上了shuffle。
everyday iam shuffling
j*****h
发帖数: 2577
9
苹果公司主要的代工厂商都在台湾地区.据台湾媒体引述业内人士的话说,苹果公司将
在九月五日的发布会上推出新版的全线iPod产品,台湾多家厂商正在为苹果制造新版
播放器产品.
据台湾业内人士透露,苹果公司新版的iPod播放器(带有视频的叫做iPod,iPod Nano和
Shuffle没有视频播放功能)使用触摸屏操作界面,播放器将使用宽屏显示屏,此外,还
将增加无线局域网的接入功能.另外,苹果公司将会在新版的iPod(视频版)中使用NAND
闪存,取代传统的微型硬盘.
消息人士透露,苹果公司已经把新版iPod播放器的制造合同给了台湾的英业达公司,该
公司预计将在九月底到十月初向苹果公司交付产品.
据消息人士透露,除了新版的iPod之外,苹果公司将会在九月五日的发布会上推出新版
的iPod Nano和iPod Shuffle,以迎接圣诞购物旺季的到来.Nano版将增加存储容量,但
是价格保持不变,外观酷似iPhone,将由富士康电子公司代工. Shuffle版也将增加容
量,价格保持不变,该产品将由华硕电脑公司代工制造.
消息人士估计说,今年第四季度,苹果公司新版的iPod播放器产品的销量将
y******k
发帖数: 48
10
来自主题: Apple版 - 苹果太自私了
没有前置摄像头,不能多程序同时运行
我想这两个不难实现吧,苹果就是为了出2代再赚一笔
还有,如果ipad做成一个netbook之类的话,mac之类的估计就没什么人会买了
说白了这次出的ipad根本就没有替消费者考虑,只是用来占领市场的
看看苹果原来的产品,从399刀到999刀就只有一个ipone,现在弄个四不像,设置了好
多种,终于可以从59刀通吃到2499了
转一个现在苹果的所有产品价格
59刀 2G iPod shuffle
79刀 4G iPod shuffle
99刀 4G 不锈钢外壳iPod shuffle
149刀 8G iPod nano
179刀 16G iPod nano
199刀 8G iPod touch
249刀 160G iPod classic
299刀 32G iPod touch
399刀 64G iPod touch
499刀 16G iPad(WIFI)
599刀 32G iPad(WIFI)
599刀 16G iPhone 3GS(无合约)
629刀 16G iPad(WIFI+3G)
699刀 64G iPad(WIFI)
699刀 32G iP
C*********R
发帖数: 240
11
来自主题: Apple版 - 普通WSN数码解决方案
台式机 + 笔记本 + iphone + ipod shuffle(可选)
台式机
工作娱乐主要道具,功能一定要强大,屏幕一定要大,软件一定要全
什么photoshop啊,bt啊,能搞的都给搞上
一边下载,一边看电影,一边聊天忽悠,一边灌水
笔记本
出差,开会,seminar之类用用,装个office和常用软件就行
花哨功能不需要,轻巧经摔是关键,推荐来弄我X系列
iphone
一定要3g,不然白搞了
本来不是苹果饭,但iphone实在太方便了
定位,查公共交通,找商店邮局饭馆,online check in,天气,股票,邮件,字典,
wiki
在强大的应用程序支持下,你日常的信息基本都相当随身带了,是真正意义上随身随时
随地
苹果目前唯一真正革命性的产品
ipod shuffle
iphone含了ipod,考虑到电池,如果听得多,搞个shuffle最方便,便宜实惠
ipod砖头实在傻碧,牛仔裤兜放着搁硬
其它产品有钱可以买了送人,让丫双手捧着砖头BSO,一年后二头肌都练出来了
d*********g
发帖数: 2906
12
Shuffle就2G的容量,把我的8G的歌倒来到去的太麻烦了,而且Shuffle没有display,
都没法找到
我想听的专辑或歌手,只能一只一只的慢慢来。Shuffle是彻底想都不想的。
Zune HD出来的时候我就有相同的问题,所以没有买,没有想到现在连iPod Nano都没有
按钮了。
a***y
发帖数: 19743
13
☆─────────────────────────────────────☆
mariazw2007 (KiKi) 于 (Mon Jul 19 15:33:18 2010, 美东) 提到:
发信人: mariazw2007 (KiKi), 信区: PDA
标 题: 啰嗦地讲讲我的苹果产品经历,顺便咒骂一声iphone
发信站: BBS 未名空间站 (Mon Jul 19 13:47:07 2010, 美东)
很唐僧,先给摘要:
1.前后买过(拥有过)15个苹果产品
2.Macbook Air中看不中用。
3. iphone3G购买一年后无法通话,恨死了
全剧情:
如果仅从金钱购买角度讲,怎么看我也应该是个果粉才对。先后有过两个iPod mini,
一个80G传统iPod,iPod shuffle二代加三代6个(丢过一个,又买了两个自用,三
个送人),iPod nano四代3个(一个自用,两个送人),一个Macbook Air,一个
iPhone3G,一个iTouch(送人)。
1.iPod系列
最早看到iPod时舍不得银子。400美元对于一个月拿1千出头奖学金的学生来说还... 阅读全帖
m****o
发帖数: 182
14
https://www.tensorflow.org/api_docs/python/tf/data/TextLineDataset#shuffle
有一种情况是数据量太大,那样只能shuffle index,在训练的时候用shuffled index
random access rows。我想tensorflow可以直接给省了这一步?
m****o
发帖数: 182
15
对C/C++一窍不通,没法comment你的库:)但是如果是多个文件的话,我想应该可以先
对文件名序列本身做shuffle,然后随机顺序读取文件以后,再对文件rows做random
shuffleing。如果不担心文件本身顺序是否要保持,Linux底下有一个命令shuf,可以
直接in place shuffle rows。
o***s
发帖数: 42149
16
朝鲜人讨厌美帝,他们觉得是美帝让他们的生活与首尔相异,也是他们阻挠了南北统一。朝鲜的导游每周可以接触到一次新闻,但无权收听BBC的广播;对于卡扎菲的新闻,他们所知道的只是“很多野生动物被释放且全部遭到射杀”而不知道卡扎菲已死。
朝鲜的菜肴,看上去很简单
朝鲜人的饭食,大碗套小碗,充满异国情调
在这幅照片的右侧,你能看到这个缓冲区的朝鲜一侧,那面飘在空中的旗帜就是朝鲜国旗。西方报道称,远处的那些建筑只有一个正面。朝鲜方面表示这里曾经是一个繁荣的村舍,现在却每天担心地雷威胁以及美国的侵略。在缓冲区,我看到了很多朝鲜人。不过,我并没有造访照片中展示的地方。
非军事区韩国一侧。我们去的时候并没有看到一名韩国士兵,只有数百个摄像头对着我们所在的方向。也许,只有那些更熟悉这里的人才有资格评论非军事区的日常管理。我在Netfix上看过一些影片,里边经常有两方士兵站岗的镜头。或许,这只为提高影片的买点吧。
作者的父亲正给金日成的母亲金正淑的雕像献花;他说:我只想让每一个人知道,虽然这趟朝鲜之行是包价游,但并不包括买花(5欧元)的钱。直到现在,我每每想到这件事还会笑出声来。
这座大楼的故事我也记不得了,... 阅读全帖
h*****q
发帖数: 176
17
7452 1863
5472 1368
#!/usr/bin/perl
#从1-8中随机取两个四位数,要求一个是另一个的4倍
use List::Util 'shuffle';
my @num=(1..8);
my $x=1;
my $y=1;
for(my $i=0;$i<99999;$i++){
my @new=shuffle(@num);
$x=$new[0].$new[1].$new[2].$new[3];
$y=$new[4].$new[5].$new[6].$new[7];
if($x/$y==4 or $y/$x==4){
print "$x\t$y\n";
}
}
s****e
发帖数: 5429
18
来自主题: Military版 - 江南style到底哪里好了?
很多人喜欢gangnam style 就说象LMFAO. The theme is HAPPY. 当然我更喜欢
shuffling shuffling.
k*****r
发帖数: 21039
19
What is it Like to Teach Black Students?
by Christopher Jackson
Until recently I taught at a predominantly black high school in a
southeastern state. The mainstream press gives a hint of what conditions are
like in black schools, but only a hint. Expressions journalists use like “
chaotic” or “poor learning environment” or “lack of discipline” do not
capture what really happens. There is nothing like the day-to-day experience
of teaching black children and that is what I will try to ... 阅读全帖
w*********g
发帖数: 30882
20
黑人学校和黑人世界的真相 - Chris Jackson
发信站: BBS 未名空间站 (Mon Dec 21 22:28:09 2015, 美东)
What is it Like to Teach Black Students?
by Christopher Jackson
Until recently I taught at a predominantly black high school in a
southeastern state. The mainstream press gives a hint of what conditions
are
like in black schools, but only a hint. Expressions journalists use like “
chaotic” or “poor learning environment” or “lack of discipline” do not
capture what really happens. There is nothing like the da... 阅读全帖
w******g
发帖数: 2047
21
【 以下文字转载自 Military 讨论区 】
发信人: kayaker (霜晨の月), 信区: Military
标 题: 黑人学校和黑人世界的真相 - Chris Jackson
发信站: BBS 未名空间站 (Mon Dec 21 22:28:09 2015, 美东)
What is it Like to Teach Black Students?
by Christopher Jackson
Until recently I taught at a predominantly black high school in a
southeastern state. The mainstream press gives a hint of what conditions are
like in black schools, but only a hint. Expressions journalists use like “
chaotic” or “poor learning environment” or “lack of discipline” do... 阅读全帖
c*******e
发帖数: 5818
22
来自主题: USANews版 - GOP iowa caucus rule
Republicans
By contrast, Republicans select their candidate via a simple, secret-ballot
vote.
There is no shuffling from one corner of the caucus site to the other. There
is no 15 percent viability or realignment. And there's no mathematical
formula to determine delegates awarded at each caucus site.
For example, say there are four candidates (Candidates A, B, C, D), 100
total attendees, and the site awards seven delegates.
Let's assume Candidate A gets support from 35 caucus-goers, B gets 20, C... 阅读全帖
m********g
发帖数: 10469
23
估计希拉里不尿这帮子落水狗
National Review to Endorse Hillary?
By Mike Stopa
- Satire -
Word is out that the National Review, known as the soul of intellectual
conservatism since its founding 60 years ago by conservative icon William F.
Buckley Jr., is planning to endorse Hillary Clinton for President.
According to a possibly informed source claiming to be close to the magazine
’s editorial board and demanding anonymity, assuming that businessman
Donald Trump is crowned the Republican nominee at the upcoming... 阅读全帖
b******i
发帖数: 136
24
男人是不够细心。可能是我比较穷,从来不给红包,只给东西。能买的东西还是有一些
的。
羊绒毛衣围巾帽子手套,哥伦比亚防寒服,耐克运动鞋,李维斯牛仔裤,倩碧雅时兰代
化妆品,
coach包,皮靴子ugg,瑞士军刀,Ipod shuffle,照相机,上网本,钻石首饰。再有就
是保健品
维他命西洋参巧克力混合坚果。
老年人一般穿衣不挑款式,羊绒在国内随便的都要1000块,这里macys打折后才30美元
,李维斯牛
仔裤更是800块起价,这里才33-40美元一条。coach包就更不用说了吧,outlet便宜的
太多了。
哥伦比亚在国内都是上千,我刚买了一件双层的才40刀。靴子也是都千元以上,这里打
折后才40-80
美元。化妆品就更便宜了,倩碧的黄油才21美元,国内460RMB。IPOD SHUFFLE 美国
amazon
$46,国内卖398元。照相机电脑等都是美国买便宜。
i*****8
发帖数: 3942
25
我想要的物品:
iPod shuffle in polished stainless steel 4gb
shuffle red 2gb 玫瑰红
最新一代
单张面值:
any
可接受的价格(必须明码标价!):
130+label钱 or obo
物品新旧要求:
new
邮寄方式要求:
yL
买卖双方谁承担邮寄损失(Required if not code only):
byam
付款方式说明:
paypal
其他补充说明:
广告的有效期:
物品来源:
我的联系方式
g*******y
发帖数: 1930
26
来自主题: JobHunting版 - 一道面试题
"It has been an research interest to develop in-place mergesort algorithms, almost all of which are however inpractically complicated. "
搜到的UW CSS 342: Mathematical Principles of Computing网页上的一段话。
很好奇,百度的perfect solution是什么?
btw, perfect shuffle仅仅是这个问题的一个特例而已。搞定这个问题比搞定perfect shuffle难多了。。。因为这个问题更general啊

Recruit written test last question
s*****t
发帖数: 737
27
来自主题: JobHunting版 - 问道题
Okay, it seems to me that
just keep cutting the same iCuts and then shuffle the cards
finally, you will get the original deck.
Just I could not get the number of times of shuffle and could not prove it.
I suspect it is a ring problem, needs abstract algebra to solve it.
b********h
发帖数: 119
28
来自主题: JobHunting版 - median of N^2 numbers across N machines

problem.
No. After the map phase, every bucket will be on one machine. This is due to
the shuffling between map and reduce.
Yes, the largest cost is the shuffling between map and reduce.
j********x
发帖数: 2330
29
来自主题: JobHunting版 - 请教一题算法小问题
估计跟inplace shuffling有关系
one pass scan可以得到正数和负数的分界,然后直接shuffle到指定位置好了
c*b
发帖数: 3126
30
来自主题: JobHunting版 - 请教一个题目
http://en.wikipedia.org/wiki/In_shuffle
这里引用了O(n)时间,O(1)空间的in-place shuffle
http://arxiv.org/PS_cache/arxiv/pdf/0805/0805.1598v1.pdf
用递归的话是O(nlogn)
http://www.interviewcodesnippets.com/2010/06/array-shuffle/

..
f*******4
发帖数: 1401
31
来自主题: JobHunting版 - Google电面面经 + onsite求祝福
今天下午刚面的 第一轮 新鲜出炉 题目觉得还不错 有些没见过
1. 一组数有很多重复 找所有重复的数
2. 1 ~ 10000 有一个数重复了 找出来
3. 哈希表,如果有n个key,怎么决定哈希表的大小?n小的时候
怎么办 大的时候怎么办
(我昏了。。。)
4. 如果有人知道了你的hash表来对你的哈希表进行攻击,让你的
哈希表变慢,怎么办?(假设有key从一个stream源源不断
地来而你不知道key的性质)
(又昏,想了半天最后说重新建一个hash table。面试官
说可以。)
5. 写代码:对一个数组shuffle
follow up:为什么n个数共有n!个不同的permutation
(很汗。。。)
follow up:为什么你用的shuffle算法是正确的
(和permutation是有关系的)
3个小时后收到HR的onsite邀请 求祝福
g*********s
发帖数: 1782
32
来自主题: JobHunting版 - Google电面面经 + onsite求祝福
random shuffle, or shuffle with pattern? i don't see the connection b/w
permutation and the algorithm correctness...
f*******4
发帖数: 1401
33
来自主题: JobHunting版 - Google电面面经 + onsite求祝福
random shuffle
可以用类似random shuffle的办法,就是每个人和它后面的随机的一个人
swap,来产生所有permutation,不是么?
e*****e
发帖数: 1275
34
来自主题: JobHunting版 - 问个array in place operation的题目
http://en.wikipedia.org/wiki/In_shuffle
这里引用了O(n)时间,O(1)空间的in-place shuffle
http://arxiv.org/PS_cache/arxiv/pdf/0805/0805.1598v1.pdf
用递归的话是O(nlogn)
http://www.interviewcodesnippets.com/2010/06/array-shuffle/
这题目如果事先不知道,就能当场十分钟做出来,实在是太牛了.
说实在的,我觉得面试的时候如果问这问题太不厚道.
c**y
发帖数: 172
35
来自主题: JobHunting版 - 发AMZ电面经,攒 RP
AMZ 两轮店面
第一轮:
1.实现一个hash函数,输入string,输出一个hash值。
考虑复杂了,面试官提示说不用考虑太复杂的hash函数实现。
2.实现一个hash table用来存储strings。
这个后来用STL的map做的。
第二轮:
1.口述array, linked list, binary tree, hash table的区别和特点
随便说了说,这个问题被不同的公司问过好多次了。
2.给定一个binary tree,判断是不是一个binary search tree
google一下,网上有比较好的code,很简单,用recursive方法
3.实现a deck of cards class,具体要求实现两个函数(1) DealACard (2) Shuffle
DealACard就是从当前deck中抽取一张card,怎么抽自己定义,我就说从top抽
Shuffle就是洗排。
两个面试官都很nice。
y*******g
发帖数: 6599
36
来自主题: JobHunting版 - G家电面题,求解答‏
无法读入内存,
一行大于1G不用考虑把
感觉类似merge sort, 只不过以前的sort/compare都改成shuffle就好了
把文件分成 N部分,每个分别shuffle, 然后merge的时候从N个文件里面随机去一个

的问题?
d*******r
发帖数: 208
37
来自主题: JobHunting版 - G家电面题,求解答‏
2. so total line # can be counted say 1....n. do a randome shuffle of these
line numbers. then output to a different file while reading the input file
arrange the lines with the random shuffle results.

You
in
r********g
发帖数: 1351
38
来自主题: JobHunting版 - G家电面题,求解答‏
这N个文件每个都是local的随机吧?不过受楼上的启发,我觉得是:
先分成N个文件
文件Fi(0 <= i < N)自己先shuffle
文件Fi和文件F0-F(i-1)依次shuffle一遍(参见随机洗牌的算法,假设2个文件行数相
等,对每个line取随机数k, 如果k%N==0, 就把这一行互换)。
d*******l
发帖数: 338
39
来自主题: JobHunting版 - G家电面题,求解答‏
我的一个想法:
假如内存大小是M,文件大小是N,把文件分成K块,就有N=KM。然后对每个块进行
shuffle,每个块都有M!种结果,总共有(M!)^K种结果。然后再考虑merge。每种merge
方法可以表示成一个长为N的序列,是M个1,M个2。。。M个K组成的序列的一个排列。
表示的意义就是依次从第几个块取东西。这种序列共有N!/(M!)^K种。一种merge方法和
一种分块shuffle的结果能唯一确定一种最后结果,不会有重复,所以这么操作最后可
能的结果就是(M!)^K*N!/(M!)^K=N!种结果。相当于是完全随机的。
y*******g
发帖数: 6599
40
来自主题: JobHunting版 - G家电面题,求解答‏
无法读入内存,
一行大于1G不用考虑把
感觉类似merge sort, 只不过以前的sort/compare都改成shuffle就好了
把文件分成 N部分,每个分别shuffle, 然后merge的时候从N个文件里面随机去一个

的问题?
d*******r
发帖数: 208
41
来自主题: JobHunting版 - G家电面题,求解答‏
2. so total line # can be counted say 1....n. do a randome shuffle of these
line numbers. then output to a different file while reading the input file
arrange the lines with the random shuffle results.

You
in
r********g
发帖数: 1351
42
来自主题: JobHunting版 - G家电面题,求解答‏
这N个文件每个都是local的随机吧?不过受楼上的启发,我觉得是:
先分成N个文件
文件Fi(0 <= i < N)自己先shuffle
文件Fi和文件F0-F(i-1)依次shuffle一遍(参见随机洗牌的算法,假设2个文件行数相
等,对每个line取随机数k, 如果k%N==0, 就把这一行互换)。
d*******l
发帖数: 338
43
来自主题: JobHunting版 - G家电面题,求解答‏
我的一个想法:
假如内存大小是M,文件大小是N,把文件分成K块,就有N=KM。然后对每个块进行
shuffle,每个块都有M!种结果,总共有(M!)^K种结果。然后再考虑merge。每种merge
方法可以表示成一个长为N的序列,是M个1,M个2。。。M个K组成的序列的一个排列。
表示的意义就是依次从第几个块取东西。这种序列共有N!/(M!)^K种。一种merge方法和
一种分块shuffle的结果能唯一确定一种最后结果,不会有重复,所以这么操作最后可
能的结果就是(M!)^K*N!/(M!)^K=N!种结果。相当于是完全随机的。
c******t
发帖数: 391
44
一道电面题,让实现随机洗牌算法,然后设计测试,判断是否每种shuffle后的组合都
是等可能出现的。我想到了那个抛硬币正反面的例子,就说shuffle很多次,记录每次
各个牌出现的位置,然后看分布是不是roughly equal的。
之前没有想过这个问题,就给了这个答案,不知道想错了没……
C***U
发帖数: 2406
45
来自主题: JobHunting版 - 这题咋做啊?
Shuffle a 2-3 B-Tree in place. Make sure all shuffled final orders are
equally likely
h****n
发帖数: 1093
46
来自主题: JobHunting版 - 彭博电面面经
1. why pengbo? talk about yourself and your projects
2. what is virtual function? give a example. since it is useful, why we do
not declare every function as virtual?
3. What compiler do for an empty class?
4. 2-sum problem. what if there are some duplicated items?
5. design a data structure for playlist. need to support get pre, get next,
shuffle, restore the state before the shuffle without using any extra memory.
6. how to send confidential document given public and private key? how to
prove ... 阅读全帖
h****n
发帖数: 1093
47
来自主题: JobHunting版 - 编程关于随机数的抽取
先用经典的shuffle,然后每次按次序从shuffle过后的数组里取即可
l*******b
发帖数: 2586
48
那个尾递归是这样实现的:
a1 a2 a3 a4 a5 a6 a7 b1 b2 b3 b4 b5 b6 b7
swap
a1 a2 a3 a4 b1 b2 b3 b4|a5 a6 a7 b5 b6 b7
shuffle前4个
a1 b1 a2 b2 a3 b3 a4 b4|a5 a6 a7 b5 b6 b7
swap
a1 b1 a2 b2 a3 b3 a4 b4|a5 a6 b5 b6|a7 b7
shuffle
a1 b1 a2 b2 a3 b3 a4 b4|a5 b5 a6 b6|a7 b7
然后好了.对于文章里特定长度的那种序列,是直接实现的,不调用递归
s*******u
发帖数: 220
49
来自主题: JobHunting版 - 发几个面经(8) Roket Fuel 电面 + onsite
赞,恭喜~~~
并问问牛人的解法...
1) given URLs, find the most frequent one
time complexity, compare with other solutions.
我只能想到hashmap加counter,有没有更好的?

whether string S3 is a shuffle of S1+S2?
不太明白shuffle的意思,cc上有道题是两xy是yxyx的substring,不知道是不是这个
意思~~
print n parenthesis是啥意思?是()()()还是((()))之类的?这道题怎么玩?
大谢大谢哈~~~
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)