由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - read a file and check if there's identical entry
相关主题
一道c++ 题, 找出duplicate numberssome interview questions i met and remembered
An algorithm questionC# HtmlElement.InvokeMember at Amazon.com
问个构造函数的问题又一道面试题,我是不是想多了?
[转载] A shell script question. :)TIJ上写错了?
大家要学习C++11啊, 我觉得C++11很多FEATURE,绝对不输JAVA.请问这道题怎么解决?
C++设计疑问真屎的interview
Re: 请教一道题目算法问题求教:字符串比较
BT实战Re: amazon onsite interview question (转载)
相关话题的讨论汇总
话题: check话题: identical话题: file话题: read话题: entry
进入Programming版参与讨论
1 (共1页)
g**o
发帖数: 29
1
i was asked how to check a file with a column of numbers, and need to
check if there's duplicated entries.
i answerd to use std::set, but it seems very unsatisfying...
any better idea?
t*****g
发帖数: 1275
2
sort | uniq -c
If you don't want to read everything into memory, sort the input first.

【在 g**o 的大作中提到】
: i was asked how to check a file with a column of numbers, and need to
: check if there's duplicated entries.
: i answerd to use std::set, but it seems very unsatisfying...
: any better idea?

g**o
发帖数: 29
3
thanks! works perfectly, but i was asked to implement it in c++

【在 t*****g 的大作中提到】
: sort | uniq -c
: If you don't want to read everything into memory, sort the input first.

t*****g
发帖数: 1275
4
that was what I meant..merge sort the input first and then stream in to the
application, if you want to avoid reading everything into memory

【在 g**o 的大作中提到】
: thanks! works perfectly, but i was asked to implement it in c++
g**o
发帖数: 29
5
good point

the

【在 t*****g 的大作中提到】
: that was what I meant..merge sort the input first and then stream in to the
: application, if you want to avoid reading everything into memory

i***h
发帖数: 12655
6
看题目的意思, 好象是算法题, 不是应用题
hash table?
1 (共1页)
进入Programming版参与讨论
相关主题
Re: amazon onsite interview question (转载)大家要学习C++11啊, 我觉得C++11很多FEATURE,绝对不输JAVA.
[合集] how to remove duplicates from linked list?C++设计疑问
python得问题Re: 请教一道题目
What is wrong with the code?BT实战
一道c++ 题, 找出duplicate numberssome interview questions i met and remembered
An algorithm questionC# HtmlElement.InvokeMember at Amazon.com
问个构造函数的问题又一道面试题,我是不是想多了?
[转载] A shell script question. :)TIJ上写错了?
相关话题的讨论汇总
话题: check话题: identical话题: file话题: read话题: entry