题目原文:
Given a set of n integers S = {0,1,…,N-1}and a sequence of requests of the following form:
- Remove x from S
- Find the successor of x: the smallest y in S such thaty>=x
design a data type so that all operations(except construction
在Coursera的Algorithms课程中,周练习涉及到设计一个数据结构,该结构支持从集合S中移除元素并查找元素的成功继任者,即大于或等于给定值的最小元素。要求所有操作在最坏情况下具有对数时间复杂度。通过分析,可以发现成功继任者是移除元素的集合中最大值加一。解决方案涉及使用一种数据结构来高效地存储和更新这些信息。
题目原文:
Given a set of n integers S = {0,1,…,N-1}and a sequence of requests of the following form:
design a data type so that all operations(except construction

被折叠的 条评论
为什么被折叠?
