S**Y 发帖数: 136 | 1 Given a constant number of priorities implement a priority queue with O(1) e
nqueue and dequeue implementations.
I can not think of a way doing this...O(1) enque and deque..
even with a constant number of prioritties..
Any ideas? |
h**k 发帖数: 3368 | 2 大O还是小o,这个差很远的
e
【在 S**Y 的大作中提到】 : Given a constant number of priorities implement a priority queue with O(1) e : nqueue and dequeue implementations. : I can not think of a way doing this...O(1) enque and deque.. : even with a constant number of prioritties.. : Any ideas?
|
S**Y 发帖数: 136 | 3 big O(1)
SORRY
【在 h**k 的大作中提到】 : 大O还是小o,这个差很远的 : : e
|
k***e 发帖数: 556 | 4 as the problems says, you only have const numbers that need to take care of
then just use idea similar to counting sort
by the way, i guess you are talking about priority queue.
please make problems clear.
e
【在 S**Y 的大作中提到】 : Given a constant number of priorities implement a priority queue with O(1) e : nqueue and dequeue implementations. : I can not think of a way doing this...O(1) enque and deque.. : even with a constant number of prioritties.. : Any ideas?
|
S**Y 发帖数: 136 | 5 yes. it is priority_queue(sated in the text)
can u elabrate it? thx.
of
【在 k***e 的大作中提到】 : as the problems says, you only have const numbers that need to take care of : then just use idea similar to counting sort : by the way, i guess you are talking about priority queue. : please make problems clear. : : e
|
g*******y 发帖数: 1930 | 6 就是个脑筋急转弯或者文字游戏吧。。。
题目说constant number of priorities
你就假设这个constant number = 2,i.e.,只有两种priorities。。。
【在 S**Y 的大作中提到】 : yes. it is priority_queue(sated in the text) : can u elabrate it? thx. : : of
|