<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" > <channel><title>Comments on: Heap Sort in Scala</title> <atom:link href="http://ilyasterin.com/blog/2010/01/heap-sort-in-scala.html/feed" rel="self" type="application/rss+xml" /><link>http://ilyasterin.com/blog/2010/01/heap-sort-in-scala.html</link> <description>Against the grain software and startups</description> <lastBuildDate>Thu, 26 Jan 2012 12:50:49 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Bruno Mendes</title><link>http://ilyasterin.com/blog/2010/01/heap-sort-in-scala.html#comment-119</link> <dc:creator>Bruno Mendes</dc:creator> <pubDate>Sat, 14 Aug 2010 17:35:00 +0000</pubDate> <guid isPermaLink="false">http://ilya.cobrio.com/blog/2010/01/heap-sort-in-scala.html#comment-119</guid> <description>&lt;p&gt;That&#039;s just what i was looking for. I´m new to Scala programming and while trying to understand the code i learned some interesting ways to do things, like that (N1 until N2).foreach( param =&gt; { code }) it&#039;s really useful&lt;br&gt;&lt;br&gt;Just one thing, in the end you remove the Best and Worst cases from the bechmarks array, but when you return the average you divide the partial sum by the total length. I think it should be divided by length-2.&lt;br&gt;&lt;br&gt;return sum/(sortedBm.length-2)&lt;/p&gt;&lt;p&gt;Plus, the slice function is returning length-3 items instead of length-2 items, so it should be changed to sortedBm.slice(1,sortedBm.size-1).foreach(sumFunc)&lt;/p&gt; </description> <content:encoded><![CDATA[<p>That&#8217;s just what i was looking for. I´m new to Scala programming and while trying to understand the code i learned some interesting ways to do things, like that (N1 until N2).foreach( param => { code }) it&#8217;s really useful<br /><br />Just one thing, in the end you remove the Best and Worst cases from the bechmarks array, but when you return the average you divide the partial sum by the total length. I think it should be divided by length-2.<br /><br />return sum/(sortedBm.length-2)</p><p>Plus, the slice function is returning length-3 items instead of length-2 items, so it should be changed to sortedBm.slice(1,sortedBm.size-1).foreach(sumFunc)</p>]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using memcached

Served from: ilyasterin.com @ 2012-02-05 23:08:47 -->
