Why is my Implementation of Sorted Trees So Slow?
- To: mathgroup at smc.vnet.net
- Subject: [mg36485] Why is my Implementation of Sorted Trees So Slow?
- From: Husain Ali Al-Mohssen <husain at MIT.EDU>
- Date: Sun, 8 Sep 2002 03:31:37 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I am trying to implement a very simple sorted tree to quickly store some
real numbers I need. I have written an add, delete, minimum, and pop
(delete the lowest value) function and they seem to work ok but are very
slow. Let's just look @ my implementation of the add part:
nums=Null;(*my initial blank Tree)
Now this is my attempt to test how fast my add works:
(running on Mathematica 4.1 on a win2k VMWare machine running on Linux RH7.3
running on an 1.4GHz Athlon with 1GB of ram).
1. Is this as fast as I can get my code to run?
2. Am I doing something obviously stupid?
3. would Compiling things help?
Prev by Date:
PDE & Complex solving problem
Next by Date:
2 gifs side by side -- with hyperlinks
Previous by thread:
Re: PDE & Complex solving problem
Next by thread:
RE: Why is my Implementation of Sorted Trees So Slow?