<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>dsa Forum Rss Feed</title><link>http://www.codeplex.com/dsa/Thread/List.aspx</link><description>dsa Forum Rss Description</description><item><title>New Post: How should a new node with the same value be inserted?</title><link>http://dsa.codeplex.com/discussions/404531</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Say a tree has an existing node with value 1. If another node of same value is to be added , which side should it go?&lt;/p&gt;
&lt;p&gt;Your document states to go RIGHT : &amp;nbsp;&amp;quot;&amp;nbsp;where the left subtree of x&amp;nbsp; contains nodes with values &amp;lt; x&amp;nbsp;and the right subtree contains nodes whose values are &amp;gt;= x .&amp;quot;&lt;/p&gt;
&lt;p&gt;Whereas an article from &lt;a href="http://cslibrary.stanford.edu/110/BinaryTrees.html"&gt;
Stanford&lt;/a&gt; states to go LEFT : &amp;quot;a&lt;span&gt;ll elements in its left subtree are less-or-equal to the node (&amp;lt;=), and all the elements in its right subtree are greater than the node (&amp;gt;).&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Provided code sample ignores duplicates. &amp;nbsp;I am not sure which side to take?&lt;/p&gt;
&lt;/div&gt;</description><author>antonyd</author><pubDate>Mon, 26 Nov 2012 00:55:41 GMT</pubDate><guid isPermaLink="false">New Post: How should a new node with the same value be inserted? 20121126125541A</guid></item><item><title>New Post: Why does ICommonBinaryTreeNode have a TNode generic parameter?</title><link>http://dsa.codeplex.com/discussions/404514</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Also, &amp;nbsp;CommonBinaryTree&amp;lt;TNode,TValue&amp;gt; restricts the use of &lt;strong&gt;TNode&lt;/strong&gt; to a&amp;nbsp;ICommonBinaryTreeNode, i.e the node should ONLY have LEFT and RIGHT children. This also means that I cannot implement any generic &amp;nbsp;node say TOP,BOTTOM and hence I am still
 wondering the rationale behind &lt;strong&gt;TNode&lt;/strong&gt; in &lt;strong&gt;&amp;nbsp;ICommonBinaryTreeNode&amp;lt;TNode,TValue&amp;gt;.
&lt;/strong&gt;Hope I am making some sense , please correct my understanding.&lt;/p&gt;
&lt;/div&gt;</description><author>antonyd</author><pubDate>Sun, 25 Nov 2012 18:15:36 GMT</pubDate><guid isPermaLink="false">New Post: Why does ICommonBinaryTreeNode have a TNode generic parameter? 20121125061536P</guid></item><item><title>New Post: Why does ICommonBinaryTreeNode have a TNode generic parameter?</title><link>http://dsa.codeplex.com/discussions/404514</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;A relatively easier implementation of this interface could be&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="color:black; background-color:white"&gt;
&lt;pre&gt;&lt;span style="color:blue"&gt;public&lt;/span&gt; &lt;span style="color:blue"&gt;interface&lt;/span&gt; ICommonBinaryTreeNode&amp;lt;T&amp;gt;
    {
        ICommonBinaryTreeNode&amp;lt;T&amp;gt; Left { &lt;span style="color:blue"&gt;get&lt;/span&gt;; &lt;span style="color:blue"&gt;set&lt;/span&gt;; }

        ICommonBinaryTreeNode&amp;lt;T&amp;gt; Right { &lt;span style="color:blue"&gt;get&lt;/span&gt;; &lt;span style="color:blue"&gt;set&lt;/span&gt;; }

        TValue Value { &lt;span style="color:blue"&gt;get&lt;/span&gt;; &lt;span style="color:blue"&gt;set&lt;/span&gt;; }
    }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;But, I understand the intention of the authors that the Left &amp;amp; Right children could a node of any other type. Can you cite an tree example that could take advantage of the generic parameter &amp;lt;Tnode&amp;gt; ?&lt;/p&gt;
&lt;/div&gt;</description><author>antonyd</author><pubDate>Sun, 25 Nov 2012 17:12:42 GMT</pubDate><guid isPermaLink="false">New Post: Why does ICommonBinaryTreeNode have a TNode generic parameter? 20121125051242P</guid></item><item><title>New Post: Error loading Dsa.test.csproj project in monodevelop.</title><link>http://dsa.codeplex.com/discussions/404471</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;If you are trying to see the code using monodevelop, then you could most likely run into an error when loading Dsa.test.csproj. &amp;nbsp;This is because of a projectguid reference to mstest (though all projects are Nunit based). To overcome this problem , remove
 this line from Dsa.Test.csproj&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;ProjectTypeGuids&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4....&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Just thought someone might benefit&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;</description><author>antonyd</author><pubDate>Sun, 25 Nov 2012 00:14:26 GMT</pubDate><guid isPermaLink="false">New Post: Error loading Dsa.test.csproj project in monodevelop. 20121125121426A</guid></item><item><title>New Post: Boundary conditions</title><link>http://dsa.codeplex.com/Thread/View.aspx?ThreadId=231823</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi moderators&lt;/p&gt;
&lt;p&gt;I was going through your code project. I started with Algorithms/Numbers.cs. Some of the boundary cases have not been checked. Please go through the list and consider applying them.&lt;/p&gt;
&lt;p&gt;I am enlisting a few here. More to come.&lt;/p&gt;
&lt;p&gt;1. Fibonacci, GCD, Tobinary, ToOctal methods have to check for integer overflow if given the max value of integer.&lt;/p&gt;
&lt;p&gt;2. ToBinary, ToOctal methods need to check what will happen if the number is zero (0).&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</description><author>justINcoder</author><pubDate>Thu, 21 Oct 2010 15:06:12 GMT</pubDate><guid isPermaLink="false">New Post: Boundary conditions 20101021030612P</guid></item><item><title>New Post: The base class is missing.</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=34607</link><description>&lt;div style="line-height: normal;"&gt;Sorry for the inconvenience, it has been fixed...&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;</description><author>lukadt</author><pubDate>Thu, 11 Sep 2008 12:51:00 GMT</pubDate><guid isPermaLink="false">New Post: The base class is missing. 20080911125100P</guid></item><item><title>New Post: The base class is missing.</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=34607</link><description>&lt;div style="line-height: normal;"&gt;I downloaded the latest code, and it complains that the base class is missing.&lt;br&gt;
&lt;/div&gt;</description><author>yuren1978</author><pubDate>Sat, 30 Aug 2008 13:20:40 GMT</pubDate><guid isPermaLink="false">New Post: The base class is missing. 20080830012040P</guid></item><item><title>New Post: It is already in .net?</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=32372</link><description>&lt;div style="line-height: normal;"&gt;Quicksort is used in Array.Sort but our quicksort can be used on anything that implements IList&amp;lt;T&amp;gt;.&lt;br&gt;
&lt;br&gt;
As for doubly linked list, I think it does use a different implementation - it is there probably because it was one of the first data structures in there. I did some perf testing a while back and our doubly linked list was faster than LinkedList&amp;lt;T&amp;gt;.&lt;br&gt;
&lt;br&gt;
For now it will stay, unless we find a reason to get rid of it.
&lt;/div&gt;</description><author>gbarnett</author><pubDate>Sun, 27 Jul 2008 20:58:48 GMT</pubDate><guid isPermaLink="false">New Post: It is already in .net? 20080727085848P</guid></item><item><title>New Post: It is already in .net?</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=32372</link><description>&lt;div style="line-height: normal;"&gt;According to the front page: &amp;quot;&lt;span id="ctl00_ctl00_Content_TabContentPanel_Content_wikiSourceLabel"&gt;Data
Structures and Algorithms (DSA) features implementations of data
structures and algorithms that are not implemented in any version of
.NET.&amp;quot;&lt;br&gt;
&lt;br&gt;
But &lt;/span&gt;&lt;span id="ctl00_ctl00_Content_TabContentPanel_Content_wikiSourceLabel"&gt;DoublyLinkedList is already implemented in .net? Or is it because it has a different implementation that would cause one to use &lt;/span&gt;&lt;span id="ctl00_ctl00_Content_TabContentPanel_Content_wikiSourceLabel"&gt;DoublyLinkedList instead of&amp;nbsp;&lt;/span&gt;&lt;span id="ctl00_ctl00_Content_TabContentPanel_Content_wikiSourceLabel"&gt;&lt;/span&gt;LinkedList&lt;span&gt;&amp;lt;T&amp;gt;?&lt;br&gt;
&lt;br&gt;
A&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;lso, the Quick sort algorithm is also already implemented in .net in the form of Array.Sort(). It uses a unstable quick sort if I remember correctly.&lt;br&gt;
&lt;/div&gt;</description><author>genbox</author><pubDate>Sun, 27 Jul 2008 19:16:13 GMT</pubDate><guid isPermaLink="false">New Post: It is already in .net? 20080727071613P</guid></item><item><title>New Post: A question about Fibonacci's numbers generator</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=30073</link><description>&lt;div style="line-height: normal;"&gt;Hi Gianluca, i'm glad you are giving us&amp;nbsp;interesting feedback and focus on Fibonacci complexity. Binet's formula it's very surprising and interesting at the same time but in real world there are&amp;nbsp;some built-in limits for the number of decimal places&amp;nbsp;one can accurately compute (floating point limited precision). Sometimes these inaccuracies will make numbers round to the wrong values and carry to inappropriate result. The approach we&amp;nbsp;adopted&amp;nbsp;improves the classical algorithm definition using the memory during the computation in such a way&amp;nbsp;&amp;nbsp;that&amp;nbsp;the values of two consecutive terms of the Fibonacci sequence are always stored in the memory thus avoiding unnecessary computing...&lt;br&gt;
Hear you soon, Luca&lt;br&gt;
&lt;/div&gt;</description><author>lukadt</author><pubDate>Mon, 23 Jun 2008 14:27:37 GMT</pubDate><guid isPermaLink="false">New Post: A question about Fibonacci's numbers generator 20080623022737P</guid></item><item><title>New Post: A question about Fibonacci's numbers generator</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=30073</link><description>&lt;div style="line-height: normal;"&gt;I looked at the Fibonacci's generator and I would ask a question about it: why did you choose to implement the generator using the iterative formula instead of the closed form version? With the iterative formula f(n)=f(n-1)+f(n-2) one has to do 'n' passes to get the n-th fibonacci's number and in this case the complexity is obviously O(n). However, the iterative formula can be &amp;quot;rolled up&amp;quot; and rewritten in closed form (the so called Binet's formula), so it is required only the 'n' to get the n-th number and the complexity drops to O(1) (a constant time!).&lt;br&gt;
&lt;br&gt;
Here is the Binet's closed formula of the Fibonacci's series:&lt;br&gt;
f(n) = floor((1/2)+((g^n)/sqrt(5))); where 'g' is the golden ratio equal to g=(1+sqrt(5))/2;&lt;br&gt;
&lt;br&gt;
Bye!&lt;br&gt;
Gianluca&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;</description><author>GianlucaGhettini</author><pubDate>Sun, 22 Jun 2008 13:19:28 GMT</pubDate><guid isPermaLink="false">New Post: A question about Fibonacci's numbers generator 20080622011928P</guid></item><item><title>New Post: Stability of sorting algorithms...</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=30002</link><description>&lt;div style="line-height: normal;"&gt;&lt;br&gt;
&lt;div style="border-right:medium none;padding-right:0.2em;padding-left:0.2em;border-top:#aaa 0.1em dotted;padding-bottom:0.2em;margin:1em 0em 2.5em 3em;border-left:medium none;padding-top:0.2em;border-bottom:#aaa 0.1em dotted;font-style:italic"&gt;&lt;br&gt;
GianlucaGhettini wrote:&lt;br&gt;
Yes, IComparable interface allows deeper control over sorting. In fact I use to reimplement this interface to get the right behavior from my sorting algorithm (i.e. sorting again over equal key objects to break the tie). However, I think that the stability is a very basic property of a sorting algorithm and it should not be left to reimplement over and over again.&lt;br&gt;
&lt;br&gt;
Gianluca&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
There is a fine line between giving the programmer more control, and providing generalised solutions - all I can say is that we will look at it. &lt;br&gt;
&lt;br&gt;
Thanks for your feedback!&lt;br&gt;
&lt;br&gt;
Granville
&lt;/div&gt;</description><author>gbarnett</author><pubDate>Sun, 22 Jun 2008 11:29:37 GMT</pubDate><guid isPermaLink="false">New Post: Stability of sorting algorithms... 20080622112937A</guid></item><item><title>New Post: Stability of sorting algorithms...</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=30002</link><description>&lt;div style="line-height: normal;"&gt;Yes, IComparable interface allows deeper control over sorting. In fact I use to reimplement this interface to get the right behavior from my sorting algorithm (i.e. sorting again over equal key objects to break the tie). However, I think that the stability is a very basic property of a sorting algorithm and it should not be left to reimplement over and over again.&lt;br&gt;
&lt;br&gt;
Gianluca&lt;br&gt;
&lt;/div&gt;</description><author>GianlucaGhettini</author><pubDate>Sun, 22 Jun 2008 08:52:55 GMT</pubDate><guid isPermaLink="false">New Post: Stability of sorting algorithms... 20080622085255A</guid></item><item><title>New Post: Stability of sorting algorithms...</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=30002</link><description>&lt;div style="line-height: normal;"&gt;Hi Gianluca,&lt;br&gt;
&lt;br&gt;
For now what I will say is that we will look into it BUT you can actually take a more atomic approach over sorting by implementing the IComparable interface on the complex types, this is what DSA sorting algorithms use to verify who is larger than who, less than etc.&lt;br&gt;
&lt;br&gt;
Thanks for the comment and I will add it to our unofficial to-look-at list.&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Granville
&lt;/div&gt;</description><author>gbarnett</author><pubDate>Sat, 21 Jun 2008 16:29:53 GMT</pubDate><guid isPermaLink="false">New Post: Stability of sorting algorithms... 20080621042953P</guid></item><item><title>New Post: Stability of sorting algorithms...</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=30002</link><description>&lt;div style="line-height: normal;"&gt;&lt;span&gt;Hi, good job!!!&lt;br&gt;
I'm a Luca's friend and I'm currently programming in .NET (sometimes with Luca, at university).&lt;br&gt;
&lt;br&gt;
.NET is a very powerful and interesting framework, but IHMO I think it&lt;br&gt;
lacks control over sorting algorithms. What I'm trying to point out is&lt;br&gt;
about stability of a sorting algorithm.&lt;br&gt;
A sorting algorithm is stable if maintains the relative order of records&lt;br&gt;
with equal keys (i.e., values). That is, a sorting algorithm is stable&lt;br&gt;
if whenever there are two records R and S with the same key and with R&lt;br&gt;
appearing before S in the original list, R will appear before S in the&lt;br&gt;
sorted list.&lt;br&gt;
This property isn't critical when you are dealing with base types like&lt;br&gt;
integers or strings, but can be very useful when you are sorting more&lt;br&gt;
complex objects. I mean, suppose you have a simple array of integers,&lt;br&gt;
like this:&lt;br&gt;
[6 5 2 5 1 7 1]&lt;br&gt;
sorting it is straigthforward, we always obtain:&lt;br&gt;
[1 1 2 5 5 6 7]&lt;br&gt;
The first two integers of the sorted array are 1 1. Reversing the order&lt;br&gt;
of this two integers doesn't change the array. So, for example, when you&lt;br&gt;
are sorting a random array that contains two 1's, the 1 1 sequence&lt;br&gt;
appearing in the sorted array will always be the same, no matter if the&lt;br&gt;
algorithm you are using is stable or not.&lt;br&gt;
Now think you have an array of animals, and that you are sorting by&lt;br&gt;
number of legs. Now stability makes the difference:&lt;br&gt;
To figure out why, suppose you have this two arrays:&lt;br&gt;
&lt;br&gt;
[cow, snake, dog, cat, chicken, ant]&lt;br&gt;
&lt;br&gt;
and:&lt;br&gt;
&lt;br&gt;
[dog, ant, chicken, cow, cat]&lt;br&gt;
&lt;br&gt;
with an unstable algorithm you can obtain:&lt;br&gt;
&lt;br&gt;
[snake, chicken, cow, dog, cat, ant]&lt;br&gt;
&lt;br&gt;
and:&lt;br&gt;
&lt;br&gt;
[chicken, dog, cow, cat, ant]&lt;br&gt;
&lt;br&gt;
with a stable algorithm:&lt;br&gt;
&lt;br&gt;
[snake, chicken, cow, dog, cat, ant]&lt;br&gt;
&lt;br&gt;
and:&lt;br&gt;
&lt;br&gt;
[chicken, cow, dog, cat, ant]&lt;br&gt;
&lt;br&gt;
As you can see, the stable version of the algorithm always preserves the&lt;br&gt;
order of the sequence [cow, dog, cat] (although this order is arbitrary)&lt;br&gt;
in every array containings these animals, while the other MAY not.&lt;br&gt;
.NET doesn't allow the programmer to know if the sorting algorithm&lt;br&gt;
he/she's using is stable or not (some algorithms can be either stable or&lt;br&gt;
unstable).&lt;br&gt;
I'd like to deal with a stability-aware DSA framework!!! :)&lt;/span&gt;
&lt;/div&gt;</description><author>GianlucaGhettini</author><pubDate>Fri, 20 Jun 2008 13:55:51 GMT</pubDate><guid isPermaLink="false">New Post: Stability of sorting algorithms... 20080620015551P</guid></item><item><title>NEW POST: Comments about Set&lt;T&gt; implementation</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=22630</link><description>&lt;div class="wikidoc"&gt;
I'll look into it&lt;br /&gt; &lt;br /&gt;Thanks,&lt;br /&gt; &lt;br /&gt;Granville&lt;br /&gt; &lt;br /&gt;&lt;div class="quote"&gt;
 &lt;br /&gt;mstrobel wrote:&lt;br /&gt;Hi there,&lt;br /&gt; &lt;br /&gt;I have some observations about the Set&amp;lt;T&amp;gt; class.  First, a Set&amp;lt;T&amp;gt; wraps some other CollectionBase&amp;lt;T&amp;gt;, which it takes as a constructor parameter.  Since there is no guarantee that the wrapped collection is a set of unique entities (it may be populated with several duplicates), then there is no guarantee that any Set&amp;lt;T&amp;gt; is actually a unique set.  However, since Set&amp;lt;T&amp;gt; already implements CollectionBase&amp;lt;T&amp;gt;, I don't see why it's necessary to wrap another collection at all.  Since all of the collection manipulation methods (Add, Remove, etc.) operate directly on the wrapped set, then why not simply have Set&amp;lt;T&amp;gt; extend a fully-functional collection type (e.g. a BinarySearchTree&amp;lt;T&amp;gt; with an IComparer&amp;lt;T&amp;gt; implementation that compares hashcodes) and override the Add method to include a uniqueness check?&lt;br /&gt; &lt;br /&gt;Cheers,&lt;br /&gt;Mike&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>gbarnett</author><pubDate>Fri, 22 Feb 2008 12:07:50 GMT</pubDate><guid isPermaLink="false">NEW POST: Comments about Set&lt;T&gt; implementation 20080222120750P</guid></item><item><title>NEW POST: Comments about Set&lt;T&gt; implementation</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=22630</link><description>&lt;div class="wikidoc"&gt;
Hi there,&lt;br /&gt; &lt;br /&gt;I have some observations about the Set&amp;lt;T&amp;gt; class.  First, a Set&amp;lt;T&amp;gt; wraps some other CollectionBase&amp;lt;T&amp;gt;, which it takes as a constructor parameter.  Since there is no guarantee that the wrapped collection is a set of unique entities (it may be populated with several duplicates), then there is no guarantee that any Set&amp;lt;T&amp;gt; is actually a unique set.  However, since Set&amp;lt;T&amp;gt; already implements CollectionBase&amp;lt;T&amp;gt;, I don't see why it's necessary to wrap another collection at all.  Since all of the collection manipulation methods (Add, Remove, etc.) operate directly on the wrapped set, then why not simply have Set&amp;lt;T&amp;gt; extend a fully-functional collection type (e.g. a BinarySearchTree&amp;lt;T&amp;gt; with an IComparer&amp;lt;T&amp;gt; implementation that compares hashcodes) and override the Add method to include a uniqueness check?&lt;br /&gt; &lt;br /&gt;Cheers,&lt;br /&gt;Mike&lt;br /&gt;
&lt;/div&gt;</description><author>mstrobel</author><pubDate>Fri, 22 Feb 2008 02:10:41 GMT</pubDate><guid isPermaLink="false">NEW POST: Comments about Set&lt;T&gt; implementation 20080222021041A</guid></item><item><title>NEW POST: Extension methods or static methods?</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=16793</link><description>&lt;div class="wikidoc"&gt;
True. I'll admit I didn't actually try the normal route until a week or so after starting this thread - but I would encourage the ext method way as it increases the synergy between the BCL and DSA.&lt;br /&gt; &lt;br /&gt;Thanks Mike!&lt;br /&gt; &lt;br /&gt;&lt;div class="quote"&gt;
 &lt;br /&gt;mstrobel wrote:&lt;br /&gt;Hi Granville,&lt;br /&gt; &lt;br /&gt;I fully embrace extension methods.  Not only do they allow for the same invocation style as instance methods, but they can also be called in the same way as regular static methods, like so:&lt;br /&gt; &lt;br /&gt;public static class Algorithms&lt;br /&gt;{&lt;br /&gt;    public static IList&amp;lt;T&amp;gt; BubbleSort&amp;lt;T&amp;gt;(this IList&amp;lt;T&amp;gt; source) { ... }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;var myList = new List&amp;lt;T&amp;gt; { 5, 2, 7, 1, 8 };&lt;br /&gt;var sortedList1 = myList.BubbleSort();&lt;br /&gt;var sortedList2 = Algorithms.BubbleSort(myList);&lt;br /&gt; &lt;br /&gt;Since you get the best of both worlds, it makes little sense not to use extension methods :).&lt;br /&gt; &lt;br /&gt;Cheers,&lt;br /&gt;Mike&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>gbarnett</author><pubDate>Thu, 21 Feb 2008 19:47:12 GMT</pubDate><guid isPermaLink="false">NEW POST: Extension methods or static methods? 20080221074712P</guid></item><item><title>NEW POST: Efficiency of Heap.Remove</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=22604</link><description>&lt;div class="wikidoc"&gt;
Good catch. I actually added all that stuff the other day off the top of my head so bare with me on that as its sort of a skim at the moment.&lt;br /&gt; &lt;br /&gt;Thanks for the catch. &lt;br /&gt; &lt;br /&gt;p.s. if you find any others that are inaccurate please let me know, like I said it was skim through the source but I think the addition of this is pretty decent.&lt;br /&gt; &lt;br /&gt;&lt;div class="quote"&gt;
 &lt;br /&gt;mstrobel wrote:&lt;br /&gt;Hi there,&lt;br /&gt; &lt;br /&gt;Great work on the library, and I like the addition of the new extension methods :).&lt;br /&gt; &lt;br /&gt;I noticed that the documentation for the Heap.Remove method claims an asymptotic upper bound of O(log n).  However, the first line of the method is a call to Array.IndexOf, which I believe is O(n), which is faster growing than O(log n).  I haven't analyzed the method in detail, but removing that call should improve the efficiency of the method so that it actually is O(log n).  I haven't looked at the efficiency of any other methods--this just happened to catch my eye as I was perusing the source code :).&lt;br /&gt; &lt;br /&gt;Cheers,&lt;br /&gt;Mike&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;</description><author>gbarnett</author><pubDate>Thu, 21 Feb 2008 19:45:38 GMT</pubDate><guid isPermaLink="false">NEW POST: Efficiency of Heap.Remove 20080221074538P</guid></item><item><title>NEW POST: Extension methods or static methods?</title><link>http://www.codeplex.com/dsa/Thread/View.aspx?ThreadId=16793</link><description>&lt;div class="wikidoc"&gt;
Hi Granville,&lt;br /&gt; &lt;br /&gt;I fully embrace extension methods.  Not only do they allow for the same invocation style as instance methods, but they can also be called in the same way as regular static methods, like so:&lt;br /&gt; &lt;br /&gt;public static class Algorithms&lt;br /&gt;{&lt;br /&gt;    public static IList&amp;lt;T&amp;gt; BubbleSort&amp;lt;T&amp;gt;(this IList&amp;lt;T&amp;gt; source) { ... }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;var myList = new List&amp;lt;T&amp;gt; { 5, 2, 7, 1, 8 };&lt;br /&gt;var sortedList1 = myList.BubbleSort();&lt;br /&gt;var sortedList2 = Algorithms.BubbleSort(myList);&lt;br /&gt; &lt;br /&gt;Since you get the best of both worlds, it makes little sense not to use extension methods :).&lt;br /&gt; &lt;br /&gt;Cheers,&lt;br /&gt;Mike&lt;br /&gt;
&lt;/div&gt;</description><author>mstrobel</author><pubDate>Thu, 21 Feb 2008 17:34:13 GMT</pubDate><guid isPermaLink="false">NEW POST: Extension methods or static methods? 20080221053413P</guid></item></channel></rss>