<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Maintaining balance [A versatile red-black tree implementation for .NET (via Silverlight/WPF Charting)]</title><link>http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx</link><description>Problem I spent some time in my last post explaining how Silverlight/WPF Charting takes advantage of an ordered multi-dictionary to improve the performance of various scenarios . I wrote about Charting's use of a custom binary tree implementation and</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Delay's Blog : Maintaining balance [A versatile red-black tree implementation for .NET (via Silverlight/WPF Charting)]</title><link>http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx#9688539</link><pubDate>Wed, 03 Jun 2009 04:36:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9688539</guid><dc:creator>Delay's Blog : Maintaining balance [A versatile red-black tree implementation for .NET (via Silverlight/WPF Charting)]</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx"&gt;http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Maintaining balance [A versatile red-black tree implementation for .NET (via Silverlight/WPF Charting)] - Delay's Blog</title><link>http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx#9690917</link><pubDate>Wed, 03 Jun 2009 14:36:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9690917</guid><dc:creator>DotNetShoutout</dc:creator><description>&lt;p&gt;Thank you for submitting this cool story - Trackback from DotNetShoutout&lt;/p&gt;
</description></item><item><title>re: Maintaining balance [A versatile red-black tree implementation for .NET (via Silverlight/WPF Charting)]</title><link>http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx#9698392</link><pubDate>Thu, 04 Jun 2009 08:38:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9698392</guid><dc:creator>obsid</dc:creator><description>&lt;p&gt;You know it would be nice if we could “automatically” use these kinds of cool algorithms just by using an OrderedDictionary. &amp;nbsp;Clearly the current OrderedDictionary works great for reading values/keys, but horrible for insert/delete or memory size. &amp;nbsp;Be nice if there was say a way to do &lt;/p&gt;
&lt;p&gt;var myDictionary = new OrderedDictionary(0,1,0, 10000);&lt;/p&gt;
&lt;p&gt;Where there is an overload of the constructor that would have PerfMemory, PerfRead, PerfWrite, and PerfSize; expecting a float between 0 and 1 for each other then perfsize which is an estimated size. &amp;nbsp;In the case above, I do almost all read operations and don’t care about memory or insert/delete and expect about 10000 items. &amp;nbsp;Based on which things are important, it would select an algorithm that would be good for that situation. &amp;nbsp;Most (good) algorithms involve tradeoffs between situations which value each of the above types differently. &amp;nbsp;In this way, rather than selecting the algorithm that will be used, the programmer is just expressing the important of various perf goals.&lt;/p&gt;
</description></item><item><title>re: Maintaining balance [A versatile red-black tree implementation for .NET (via Silverlight/WPF Charting)]</title><link>http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx#9700492</link><pubDate>Fri, 05 Jun 2009 03:05:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9700492</guid><dc:creator>Delay</dc:creator><description>&lt;p&gt;obsid,&lt;/p&gt;
&lt;p&gt;This is an interesting idea! I'm not sure how practical I think it is to try to collapse what can sometimes be pretty complicated performance decisions into a just 4 parameters, but I see your point and think this might not be so hard at the low end (i.e., for simpler scenarios). I'll pass this on to a couple of folks I work with to see what they think. Thanks very much for the feedback!&lt;/p&gt;
</description></item><item><title>re: Maintaining balance [A versatile red-black tree implementation for .NET (via Silverlight/WPF Charting)]</title><link>http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx#9702327</link><pubDate>Sat, 06 Jun 2009 03:07:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9702327</guid><dc:creator>Delay</dc:creator><description>&lt;p&gt;obsid,&lt;/p&gt;
&lt;p&gt;I passed this on to someone internally, and their reaction was similar to mine. :) The suggestion was to create an issue for this Connect (&lt;a rel="nofollow" target="_new" href="http://connect.microsoft.com/"&gt;http://connect.microsoft.com/&lt;/a&gt;) so that other customers can see it and vote for it. If enough people start asking for this, that will increase its chances of being incorporated into a future version of .NET.&lt;/p&gt;
&lt;p&gt;Hope this helps! :)&lt;/p&gt;
</description></item><item><title>re: Maintaining balance [A versatile red-black tree implementation for .NET (via Silverlight/WPF Charting)]</title><link>http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx#9777463</link><pubDate>Thu, 18 Jun 2009 23:58:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9777463</guid><dc:creator>hintzen</dc:creator><description>&lt;p&gt;Have you looked at using a SkipList instead of a binary tree? &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://en.wikipedia.org/wiki/Skip_list"&gt;http://en.wikipedia.org/wiki/Skip_list&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It has efficiecny right up there with binary tree (number of probes proportional to log n) with super fast insert / delete / implementation.&lt;/p&gt;
&lt;p&gt;I really don't understand why SkipList is not looked as as the first alternate for BinaryTrees, Microsoft sponsered the original work on this theory I believe.&lt;/p&gt;
</description></item><item><title>re: Maintaining balance [A versatile red-black tree implementation for .NET (via Silverlight/WPF Charting)]</title><link>http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx#9778410</link><pubDate>Fri, 19 Jun 2009 05:14:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9778410</guid><dc:creator>Delay</dc:creator><description>&lt;p&gt;hintzen,&lt;/p&gt;
&lt;p&gt;I'd been only peripherally aware of skip lists before reading that article - thank you very much for sharing it! The ideas there sound interesting and the claim that skip lists are simpler than competing data structures is worth looking into. In our case with Charting, because we already had code that was working with a binary tree, switching to a red-black tree seemed like a pretty simple and risk-free move. The code for the left-leaning red-black tree ended up being relatively compact, so I'd be interested to see how a skip list implementation compares. At any rate, if we end up revisiting this decision some day, I'll definitely give skip lists some consideration.&lt;/p&gt;
&lt;p&gt;Thanks again!&lt;/p&gt;
</description></item></channel></rss>