Little mod

BlitzMax Forums/BlitzMax Programming/Little mod

Paposo(Posted 2006) [#1]
Hiii.
Sorry for my bad english

I offer a little mod for public use
Contains two class.
TMapRN is replacement for TMap.
TColaPrioritaria is a prioritary queue
The two class garant O(Log(n)) eficiency.
Sorry, the doc are in spanish. I not talk english

get the mod in ftp://www.furula.com/rvm.mod.zip

If you encounter any bug coment in forum, please

Bye,
Ramon


Cajun17(Posted 2006) [#2]
What makes your TMapRN different from the normal TMap?


Paposo(Posted 2006) [#3]
Hi.

The TMap is a tree not balanced. If the keys entered not arent distributed randomly the eficiency is very poor. The tree is degenerated
Test it introducing previos ordered keys in TMap. The time of consulting, removing or inserting is very very very increased. The eficiency is O(n).

The TMapRN use same implementation used in java Treemap. This is a tree black-red. It is balanced.
It is indiferent if the keys are ordered previous. The time of consulting, inserting, removing, etc is O(Log(n))

The value of n is the number of keys inserteds

Whith 20000 keys previosly ordered the time of inserting in TMap is 35 seconds. In TMapRN is 200 milliseconds in my machine.

Bye,
Ramon


Paposo(Posted 2006) [#4]
Sorry.

I correct some problem with visibility of certains class.
the new version are ready to download

Bye
Ramon