boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 两个面试题目讨论一下
相关主题
[电话面试] Amazon First Round
sorted linked list里insert一个node
How can one determine whether a singly linked list has a cycle?
F家电面
请教LEETCODE讲解部分的LCA一道题的变种。。
C++ 面试题目分享(1)
C++ Q62: loop in a linked list (Bloomberg)
remove a node (and its memory) from a doubly linked list
F电面
请教一个C++的小问题: Node *&curr Vs Node *curr
相关话题的讨论汇总
话题: downside话题: linked话题: list话题: sigleton话题: what
进入JobHunting版参与讨论
1 (共1页)
c***g
发帖数: 472
1
what's the downside of the sigleton?
what's the downside of the binary search tree compared to linked list?
g**e
发帖数: 6127
2

1. development confusion
2. unite test difficulty
3. possible throughput problem with multithread program
4. slightly overhead for checking instance existance every time
1. worst case BST degenerates to a linked list
2. O(logn) insert/delete time
3. conding complexity

【在 c***g 的大作中提到】
: what's the downside of the sigleton?
: what's the downside of the binary search tree compared to linked list?

c*********t
发帖数: 2921
3
我觉得对于linked list,
insert: 如果加到头,O(1); 如果要求加到某个有特定的key 的Node后的话,要从头
开始search到要加的位置,这时就是O(n)了。
delete: 如果给了那个node的指针,delete O(1); 可是如果只告诉你删除有某个给定
的key的那个Node,就是O(n).

【在 g**e 的大作中提到】
:
: 1. development confusion
: 2. unite test difficulty
: 3. possible throughput problem with multithread program
: 4. slightly overhead for checking instance existance every time
: 1. worst case BST degenerates to a linked list
: 2. O(logn) insert/delete time
: 3. conding complexity

m**q
发帖数: 189
4
For BST, it uses more spaces than linked list - two pointers per entry
compared to one.

【在 g**e 的大作中提到】
:
: 1. development confusion
: 2. unite test difficulty
: 3. possible throughput problem with multithread program
: 4. slightly overhead for checking instance existance every time
: 1. worst case BST degenerates to a linked list
: 2. O(logn) insert/delete time
: 3. conding complexity

1 (共1页)
进入JobHunting版参与讨论
相关主题
请教一个C++的小问题: Node *&curr Vs Node *curr
one linked list question
如何删除 linked list 的最后一个元素 (转载)
Google Front-end Software Engineer Phone Interview
bloomberg onsite题
How to find the kth biggest number in a BST
Lowest common ancestor of two nodes of Binary Tree
reverse random pointers of a single linked list
一个简单的java题
在版上看到的G题
相关话题的讨论汇总
话题: downside话题: linked话题: list话题: sigleton话题: what