由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - phone interview program with a small startup
相关主题
remove a node (and its memory) from a doubly linked list请教各位大牛一个K-way merge 的问题
问一题看不懂这题
哪个高手能指出我程序的问题 (20几行的代码)如何删除 linked list 的最后一个元素 (转载)
sorted linked list里insert一个node帮忙看一段小程序有没问题,谢谢
Programming interview exposed 上面的那道NULL or Cycle的linked list题很可能被这题搞挂了,sort linked list
请教linked list, 删除最后一个节点Add two linked list
问个reverse linked listreverse linked list 问题, double 和 single 的不同
那个skiplist的题谁来给谢谢leetcode 一道简单题的疑问
相关话题的讨论汇总
话题: linked话题: node话题: list话题: null话题: value
进入JobHunting版参与讨论
1 (共1页)
w**z
发帖数: 8232
1
The program is pretty easy compared to M and F, just for reference
shows a collection of linked-lists.
The bottom-most linked-list contains all the elements sorted in ascending
order (ie: 5, 8, 25, 28, etc ...).
Each linked-list above it allows you to jump to specific nodes in the bottom
list.
Each linked-list is sparser and contains fewer nodes than the linked-list
below it.
If a linked-list has a node for a particular value, then all the other
linked-lists below it will also contain that node, allowing you to cross
from one linked-list to another at these nodes.
For example, at the node with value 8 you can cross from the top-most linked
-list to any of the other linked-lists below it.
Using this structure, how would you efficiently find a value, for example,
70?
class Node {
int value;
Node next;
Node below;
}
X ------> X -----------------------------------------> NULL
X ------> X ------> X ------> X ---------------------> NULL
X ------> X -> X -> X ------> X -----------> X ------> NULL
X -> X -> X -> X -> X -> X -> X -> X -> X -> X -> X -> NULL
H 5 8 25 28 33 52 55 70 81 83
t**********h
发帖数: 2273
2
dropbox么?AppNexus?

bottom

【在 w**z 的大作中提到】
: The program is pretty easy compared to M and F, just for reference
: shows a collection of linked-lists.
: The bottom-most linked-list contains all the elements sorted in ascending
: order (ie: 5, 8, 25, 28, etc ...).
: Each linked-list above it allows you to jump to specific nodes in the bottom
: list.
: Each linked-list is sparser and contains fewer nodes than the linked-list
: below it.
: If a linked-list has a node for a particular value, then all the other
: linked-lists below it will also contain that node, allowing you to cross

m*****g
发帖数: 226
3
skip list?
p*****2
发帖数: 21240
4
感觉就是从第一个开始找,找到currentNode <= value, currentNode.next>=value
然后往下走 (如果不等于,等于就找到了)。
w**z
发帖数: 8232
5
从 Palo Alto 沿着101北上到SF, startup没有1000,也有500吧。有点.com bubble的
劲头。

【在 t**********h 的大作中提到】
: dropbox么?AppNexus?
:
: bottom

t**********h
发帖数: 2273
6
真好。。。好好找个startup,上市就退休,然后来鄙视我们把
y**********u
发帖数: 6366
7
那他那个就是副帅高,你这个就是高帅富,差别不大啊

【在 t**********h 的大作中提到】
: 真好。。。好好找个startup,上市就退休,然后来鄙视我们把
i***e
发帖数: 452
8
恩。 应该是skip list 查找了! 从顶上开始找,如果发现比当前的大,则跳到下一层
。O(logn)
v********4
发帖数: 40
9
zan
1 (共1页)
进入JobHunting版参与讨论
相关主题
leetcode 一道简单题的疑问Programming interview exposed 上面的那道NULL or Cycle的linked list题
Lowest common ancestor of two nodes of Binary Tree请教linked list, 删除最后一个节点
Twitter电面未通过问个reverse linked list
Print a binary tree in level order but starting from leaf node up to root那个skiplist的题谁来给谢谢
remove a node (and its memory) from a doubly linked list请教各位大牛一个K-way merge 的问题
问一题看不懂这题
哪个高手能指出我程序的问题 (20几行的代码)如何删除 linked list 的最后一个元素 (转载)
sorted linked list里insert一个node帮忙看一段小程序有没问题,谢谢
相关话题的讨论汇总
话题: linked话题: node话题: list话题: null话题: value