开发者

How to implement a Multiset with a RedBlack Tree?

开发者 https://www.devze.com 2023-02-13 17:29 出处:网络
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

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

精彩评论

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