<?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"
	>
<channel>
	<title>Comments on: A dead simple JavaScript Binary Search Tree (BST)</title>
	<atom:link href="http://www.themaingate.net/dev/javascript/a-dead-simple-javascript-binary-search-tree-bst/feed" rel="self" type="application/rss+xml" />
	<link>http://themaingate.net/dev/javascript/a-dead-simple-javascript-binary-search-tree-bst</link>
	<description>HTML, CSS, Javascript, PHP, and other assorted code</description>
	<pubDate>Fri, 10 Feb 2012 13:10:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: SaaS</title>
		<link>http://themaingate.net/dev/javascript/a-dead-simple-javascript-binary-search-tree-bst#comment-338</link>
		<dc:creator>SaaS</dc:creator>
		<pubDate>Thu, 09 Dec 2010 17:49:03 +0000</pubDate>
		<guid isPermaLink="false">http://themaingate.net/dev/?p=207#comment-338</guid>
		<description>This kind of markup always costs performance but it is good to look at and learn from.  Milk before meat!  Thanks for the post.</description>
		<content:encoded><![CDATA[<p>This kind of markup always costs performance but it is good to look at and learn from.  Milk before meat!  Thanks for the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Maietta</title>
		<link>http://themaingate.net/dev/javascript/a-dead-simple-javascript-binary-search-tree-bst#comment-247</link>
		<dc:creator>Nicholas Maietta</dc:creator>
		<pubDate>Mon, 07 Jun 2010 11:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://themaingate.net/dev/?p=207#comment-247</guid>
		<description>Charles Dorner wrote: "Forgive my ignorance, but why would you never want to use a binary search tree in javascript in practice?"...

Breadcrumbs? Path Trail? Whatever you may call it it's a pretty common navigational technique but there are plenty of ways to implement such a navigation tool. Normally when i see posts about JavaScript, i dont take the time to read it, let alone review the code. However; this hit me as somehow i saw one side of the tree having branches that can be followed to it's root trunk. Well, breadcrumbs tends to follow that same idea. From what i read here, traversing the tree and learning left and right.. well, we ignore one side and get the other. Sounds like a better method than what im doing currently fro breadcrumbs. So now... i am thinking about a new challenge... how to efficiently do the same task in PHP.

I could be way off base, but this way of thinking may very apply to breadcrumbs navigation. Please correct me if im wrong.</description>
		<content:encoded><![CDATA[<p>Charles Dorner wrote: &#8220;Forgive my ignorance, but why would you never want to use a binary search tree in javascript in practice?&#8221;&#8230;</p>
<p>Breadcrumbs? Path Trail? Whatever you may call it it&#8217;s a pretty common navigational technique but there are plenty of ways to implement such a navigation tool. Normally when i see posts about JavaScript, i dont take the time to read it, let alone review the code. However; this hit me as somehow i saw one side of the tree having branches that can be followed to it&#8217;s root trunk. Well, breadcrumbs tends to follow that same idea. From what i read here, traversing the tree and learning left and right.. well, we ignore one side and get the other. Sounds like a better method than what im doing currently fro breadcrumbs. So now&#8230; i am thinking about a new challenge&#8230; how to efficiently do the same task in PHP.</p>
<p>I could be way off base, but this way of thinking may very apply to breadcrumbs navigation. Please correct me if im wrong.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://themaingate.net/dev/javascript/a-dead-simple-javascript-binary-search-tree-bst#comment-228</link>
		<dc:creator>David</dc:creator>
		<pubDate>Wed, 02 Dec 2009 03:13:27 +0000</pubDate>
		<guid isPermaLink="false">http://themaingate.net/dev/?p=207#comment-228</guid>
		<description>Hi Charles,
I suppose you could implement a BST in JavaScript if you really wanted, but it would be very inefficient and slow compared to native sorting methods.  Typically you want to implement something like a BST in lower-level languages like C++ and Java.  In higher-level languages like JavaScript, all your custom-rolled sorting functions will always be slower than native sorting functions.

In the case of JavaScript, putting the data into an array and using sort() on the array would (presumably) be faster than making any custom-rolled sorting algorithm.

Also there's the issue of performance because of depth.  The bigger the tree gets, the more depth it has, and so you end up with nodes that are way down the tree, like rootNode.left.left.left.left.left.left.  Each layer of depth has a performance hit unfortunately.

Hope this helps,
-David</description>
		<content:encoded><![CDATA[<p>Hi Charles,<br />
I suppose you could implement a BST in JavaScript if you really wanted, but it would be very inefficient and slow compared to native sorting methods.  Typically you want to implement something like a BST in lower-level languages like C++ and Java.  In higher-level languages like JavaScript, all your custom-rolled sorting functions will always be slower than native sorting functions.</p>
<p>In the case of JavaScript, putting the data into an array and using sort() on the array would (presumably) be faster than making any custom-rolled sorting algorithm.</p>
<p>Also there&#8217;s the issue of performance because of depth.  The bigger the tree gets, the more depth it has, and so you end up with nodes that are way down the tree, like rootNode.left.left.left.left.left.left.  Each layer of depth has a performance hit unfortunately.</p>
<p>Hope this helps,<br />
-David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Dorner</title>
		<link>http://themaingate.net/dev/javascript/a-dead-simple-javascript-binary-search-tree-bst#comment-222</link>
		<dc:creator>Charles Dorner</dc:creator>
		<pubDate>Thu, 03 Sep 2009 20:04:52 +0000</pubDate>
		<guid isPermaLink="false">http://themaingate.net/dev/?p=207#comment-222</guid>
		<description>Hi David,

Forgive my ignorance, but why would you never want to use a binary search tree in javascript in practice?

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>Forgive my ignorance, but why would you never want to use a binary search tree in javascript in practice?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

