由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 谁会做>??????????????????????????????????????
相关主题
Ebay三电面,攒人品问几个关于hash, map, set的问题
一个面试challengeJava的hashcode和equal函数有什么用?
code review 求指导,附某知名游戏公司offline test题请教个面试题, tree和hashmap的区别
一道电面题Interview Question
没人讨论热门帖子里的两道概率题?GOOGLE 电面面经
T家店面Is this a DP problem?
贡献几道G家onsite题randomized quick sort的最坏情况时间复杂度
几个Java面试题 (转载)MS sdet面经 + bloomberg电面面经
相关话题的讨论汇总
话题: word话题: arbitrary话题: bonus
进入JobHunting版参与讨论
1 (共1页)
i***0
发帖数: 8469
1
QUESTIONS
1. Given an arbitrary text document written in English, write a program
that will generate a concordance, i.e. an alphabetical list of all word
occurrences, labeled with word frequencies. Bonus: label each word with the
sentence numbers in which each occurrence appeared.
a. a {2:1,1}
b. all {1:1}
c. alphabetical {1:1}
d. an {2:1,1}
e. appeared {1:2}
f. arbitrary {1:1}
g. bonus {1:2}
h. concordance {1:1}
i. document
G***l
发帖数: 355
2
这还不简单。
用一个hashtable存储,key是单词,values是arraylist,这个arraylist的第一个位置
存放次数,后面依次存放出现的句子数。
顺序读取文件,一个个句子一个个词的扫描。每扫描到一个词,加入到hashtable里或
者改变对于的value里面的值。
要是在java里,可以用treemap代替hashtable来存储,因为treemap的key是排序的。

the

【在 i***0 的大作中提到】
: QUESTIONS
: 1. Given an arbitrary text document written in English, write a program
: that will generate a concordance, i.e. an alphabetical list of all word
: occurrences, labeled with word frequencies. Bonus: label each word with the
: sentence numbers in which each occurrence appeared.
: a. a {2:1,1}
: b. all {1:1}
: c. alphabetical {1:1}
: d. an {2:1,1}
: e. appeared {1:2}

1 (共1页)
进入JobHunting版参与讨论
相关主题
MS sdet面经 + bloomberg电面面经没人讨论热门帖子里的两道概率题?
Amazon onsite interviewT家店面
问个问题贡献几道G家onsite题
这个面试题怎么做比较快啊?几个Java面试题 (转载)
Ebay三电面,攒人品问几个关于hash, map, set的问题
一个面试challengeJava的hashcode和equal函数有什么用?
code review 求指导,附某知名游戏公司offline test题请教个面试题, tree和hashmap的区别
一道电面题Interview Question
相关话题的讨论汇总
话题: word话题: arbitrary话题: bonus