由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - find medium number in stream 这题怎么作
相关主题
Groupon 電面median of an array of ints, 请问这题的经典回答是什么?谢谢
再问一道题这题怎么做?
How to find median of a stream of integers ?终于弄明白median of two sorted arrays了,发帖庆祝一下
[算法] unsorted array这题应该用bucket sort还是counting sort
上一题看看Median of Two Sorted Arrays这题真他妈的难
问一道老题G家onsite面经,求bless,顺便问问这情况能有戏吗
Facebook Intern面经find top K most occurring words in streaming data 这题怎么做比较好
优步面试,哎。。。征解几道large scale的数字题
相关话题的讨论汇总
话题: stream话题: given话题: median话题: find话题: numbers
进入JobHunting版参与讨论
1 (共1页)
t**r
发帖数: 3428
1
Given a stream of unsorted integers, find the median element in sorted order
at any given time. So, we will be receiving a continuous stream of numbers
in some random order and we don’t know the stream length in advance. Write
a function that finds the median of the already received numbers efficiently
at any time. - See more at: http://www.ardendertat.com/2011/11/03/programming-interview-questions-13-median-of-integer-stream/#sthash.Bn5jexex.dpuf
I*******g
发帖数: 7600
2
用两个priority_queue

order
numbers
Write
efficiently

【在 t**r 的大作中提到】
: Given a stream of unsorted integers, find the median element in sorted order
: at any given time. So, we will be receiving a continuous stream of numbers
: in some random order and we don’t know the stream length in advance. Write
: a function that finds the median of the already received numbers efficiently
: at any time. - See more at: http://www.ardendertat.com/2011/11/03/programming-interview-questions-13-median-of-integer-stream/#sthash.Bn5jexex.dpuf

s**x
发帖数: 7506
3
Cc150 上的题吧?先读一遍CC150,再刷leetcode.
m******y
发帖数: 219
4
类似quick sort的思路,把数字一个一个放到sorted后的位置,如果index正好是
Median输出,否则根据大小左右移动。两个priority queue有点大材小用
m******3
发帖数: 346
5
quick sort不行吧,stream你不知道有多少元素阿。
1 (共1页)
进入JobHunting版参与讨论
相关主题
征解几道large scale的数字题上一题看看
amazon的一道题问一道老题
问一道CareerCup里的题目Facebook Intern面经
Find Median From Mega Number Of Integers优步面试,哎。。。
Groupon 電面median of an array of ints, 请问这题的经典回答是什么?谢谢
再问一道题这题怎么做?
How to find median of a stream of integers ?终于弄明白median of two sorted arrays了,发帖庆祝一下
[算法] unsorted array这题应该用bucket sort还是counting sort
相关话题的讨论汇总
话题: stream话题: given话题: median话题: find话题: numbers