开发者

How to implement a Multiset with a RedBlack Tree?

I need some 开发者_如何学JAVAgeneral background here, and I can't find it online..

My main doubt is, if I want to implement a Multiset structure with a redblack tree, do I have to put in the RB Tree every element of the Multiset (every repeated element also..) or is there a way to save the unique elements and their multiplicity?

All this should be done only with one redblack tree, no other structures. (This is for a homework as you may have guessed..)


Just store the number of instances (>0) in each leaf.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜