<?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: A Programming Job Interview Challenge #13 &#8211; Brackets</title>
	<atom:link href="http://www.xerxesb.com/2008/a-programming-job-interview-challenge-13-brackets/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xerxesb.com/2008/a-programming-job-interview-challenge-13-brackets/</link>
	<description>&#039;Cause there are some things you just *can&#039;t* get from a book...</description>
	<lastBuildDate>Fri, 12 Nov 2010 21:27:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: A PROGRAMMING JOB INTERVIEW CHALLENGE #14 - 2D GEOMETRY &#124; Dev102.com</title>
		<link>http://www.xerxesb.com/2008/a-programming-job-interview-challenge-13-brackets/comment-page-1/#comment-1091</link>
		<dc:creator>A PROGRAMMING JOB INTERVIEW CHALLENGE #14 - 2D GEOMETRY &#124; Dev102.com</dc:creator>
		<pubDate>Tue, 05 Aug 2008 10:02:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.xerxesb.com/2008/a-programming-job-interview-challenge-13-brackets/#comment-1091</guid>
		<description>[...] http://www.xerxesb.com/2008/a-programming-job-interview-challenge-13-brackets/&#160;by Xerxes Battiwalla. [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.xerxesb.com/2008/a-programming-job-interview-challenge-13-brackets/&nbsp;by" rel="nofollow">http://www.xerxesb.com/2008/a-programming-job-interview-challenge-13-brackets/&nbsp;by</a> Xerxes Battiwalla. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Curran</title>
		<link>http://www.xerxesb.com/2008/a-programming-job-interview-challenge-13-brackets/comment-page-1/#comment-1089</link>
		<dc:creator>James Curran</dc:creator>
		<pubDate>Wed, 30 Jul 2008 14:52:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.xerxesb.com/2008/a-programming-job-interview-challenge-13-brackets/#comment-1089</guid>
		<description>Don&#039;t know the complexity?  

You perform a fixed number of steps on each character, so we start with O(n * X).  

So, now we only have to determine X.  For each character, we:
-   lookup a character in a dictionary/hashtable, we we determined in a previous Dev102 challenge is either O(1) or O(ln N) depending on the algorithm used.
-   push or pop a value from a stack: O(1).

Put them all together, we have N * 1 * 1 or N * ln N * 1.    O(N) or prehaps O(N ln N).

Of course, being O(N) isn&#039;t the final word on efficiency.  It merely means that the time it taken in given by the function:
T = C*N + K, and your C value (X in the above analysis) is rather high.  (O(1) merely means that value is fixed, not that it is low).

I gave the full code on mine at http://www.honestillusion.com

(EDIT: fixed URL link a the bottom)</description>
		<content:encoded><![CDATA[<p>Don&#8217;t know the complexity?  </p>
<p>You perform a fixed number of steps on each character, so we start with O(n * X).  </p>
<p>So, now we only have to determine X.  For each character, we:<br />
-   lookup a character in a dictionary/hashtable, we we determined in a previous Dev102 challenge is either O(1) or O(ln N) depending on the algorithm used.<br />
-   push or pop a value from a stack: O(1).</p>
<p>Put them all together, we have N * 1 * 1 or N * ln N * 1.    O(N) or prehaps O(N ln N).</p>
<p>Of course, being O(N) isn&#8217;t the final word on efficiency.  It merely means that the time it taken in given by the function:<br />
T = C*N + K, and your C value (X in the above analysis) is rather high.  (O(1) merely means that value is fixed, not that it is low).</p>
<p>I gave the full code on mine at <a href="http://www.honestillusion.com" rel="nofollow">http://www.honestillusion.com</a></p>
<p>(EDIT: fixed URL link a the bottom)</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 disk: enhanced
Database Caching 1/7 queries in 0.009 seconds using disk: basic
Object Caching 259/263 objects using disk: basic

Served from: www.xerxesb.com @ 2012-02-09 00:48:42 -->
