由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 【BST创建,insert,delete的time complexity】
相关主题
请教一个问题一道非常伪善的面试题
Rejected After 2nd Phone Interview with AmazonF电面
小公司web server面经Airbnb电话面试和改进建议
两个面试题目讨论一下贡献一道 C++ 题目
google 一题hash table 如果是doubly linked 为啥删除也是 O(1)呢
问一道最新G面题delete sheets from Excel workbook in C#
BB面经google电面
t店面经amazon一面面经
相关话题的讨论汇总
话题: deleting话题: bst话题: node话题: logn话题: complexity
进入JobHunting版参与讨论
1 (共1页)
h*****g
发帖数: 944
1
convert a random array to BST: o(nlogn)
insertion: o(logn)
deletion: o(logn)
貌似deletion有三种情况,
1 Deleting a leaf (node with no children): Deleting a leaf is easy, as we
can simply remove it from the tree.
2 Deleting a node with one child: Remove the node and replace it with its
child.
3 Deleting a node with two children:
这三种情况不都是O(logn)吧?
z*******y
发帖数: 578
2
去找本算法书看看吧,基本每本算法书都讲的很清楚
r*******y
发帖数: 1081
3
this is average complexity

【在 h*****g 的大作中提到】
: convert a random array to BST: o(nlogn)
: insertion: o(logn)
: deletion: o(logn)
: 貌似deletion有三种情况,
: 1 Deleting a leaf (node with no children): Deleting a leaf is easy, as we
: can simply remove it from the tree.
: 2 Deleting a node with one child: Remove the node and replace it with its
: child.
: 3 Deleting a node with two children:
: 这三种情况不都是O(logn)吧?

1 (共1页)
进入JobHunting版参与讨论
相关主题
amazon一面面经google 一题
几道关于数据结构的面试题。问一道最新G面题
M5 Network && Microstrategy 面经BB面经
请教一个phone interview 问题t店面经
请教一个问题一道非常伪善的面试题
Rejected After 2nd Phone Interview with AmazonF电面
小公司web server面经Airbnb电话面试和改进建议
两个面试题目讨论一下贡献一道 C++ 题目
相关话题的讨论汇总
话题: deleting话题: bst话题: node话题: logn话题: complexity