<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-295168065545267996</id><updated>2026-01-11T07:50:18.618-08:00</updated><category term="compquiz"/><category term="database"/><category term="er modeling"/><category term="exam"/><category term="final"/><category term="join"/><category term="midterm"/><category term="multiple choice"/><category term="normalization"/><category term="questions"/><category term="quiz"/><category term="relational algebra"/><category term="test"/><category term="theory"/><title type='text'>Computer Science Study Guide</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>56</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-732215882252431736</id><published>2012-03-28T21:23:00.000-07:00</published><updated>2012-03-28T21:26:17.192-07:00</updated><title type='text'>Casting and Conversions in Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Integer to string&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
int i=1234;&lt;br /&gt;
String s = String.valueOf(i);&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&lt;b&gt;String to Integer&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
String s = &quot;5678&quot;;&lt;br /&gt;
int i = Integer.parseInt(s);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Character to string&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
char ch = &#39;a&#39;;&lt;br /&gt;
String s = Character.toString(ch);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;Character to integer&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
char ch = &#39;7&#39;;&lt;br /&gt;
int i = Character.getNumericValue(ch);&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #990000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/732215882252431736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2012/03/casting-and-conversions-in-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/732215882252431736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/732215882252431736'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2012/03/casting-and-conversions-in-java.html' title='Casting and Conversions in Java'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-6266122036321050641</id><published>2012-01-23T21:29:00.000-08:00</published><updated>2012-01-23T21:30:28.876-08:00</updated><title type='text'>Find Two Numbers in an Array that Sum to a Particular Value</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;We know that &lt;a href=&quot;http://en.wikipedia.org/wiki/Subset_sum_problem&quot;&gt;subset sum problem&lt;/a&gt; is np complete. But if we consider only subsets of size two, we can solve this problem in polynomial time. &lt;br /&gt;
&lt;br /&gt;
Usually people tend to come up with n**2 solution. We can have a solution of order n if we use hashmaps&lt;br /&gt;
&lt;br /&gt;
Algorithm&lt;br /&gt;
&lt;br /&gt;
Iterate the array from i=0 to arraylength-1:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(hashMap&amp;nbsp;does not contain key(sum - a[i]){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert ( a[i], sum[a-i])&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (a[i], sum-a[i])&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
Logic:&lt;br /&gt;
&lt;br /&gt;
After reading a value, check if its pair value (sum - a[i]) is already read. &lt;br /&gt;
If&amp;nbsp;pair value&amp;nbsp;is not read, insert the value read, and its pair value as key,value combination.&lt;br /&gt;
Otherwise return value and its pair value.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/6266122036321050641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2012/01/find-two-numbers-in-array-that-sum-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/6266122036321050641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/6266122036321050641'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2012/01/find-two-numbers-in-array-that-sum-to.html' title='Find Two Numbers in an Array that Sum to a Particular Value'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-8458812112442224744</id><published>2011-06-14T14:48:00.000-07:00</published><updated>2011-06-14T14:48:33.915-07:00</updated><title type='text'>Android: Mediaplayer prepare() method crashes.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;If you tried to run voice recording with code from &lt;a href=&quot;http://developer.android.com/guide/topics/media/index.html&quot;&gt;android developer site&lt;/a&gt;, you might have encountered this problem&amp;nbsp; - &amp;nbsp; prepare() method crashes. If you read logcat you can see that it is because of file permission problems. Device drive fails to create the file mentioned in the code.&lt;br /&gt;
&lt;br /&gt;
Here is the work around:&lt;br /&gt;
&lt;br /&gt;
Audio record is using a file  that is not on the driver yet. So create a file named audio.3gp in your  local file system. File can be empty.&lt;br /&gt;
On eclipse, open DDMS by Window&amp;gt; open perspective &amp;gt; DDMS&lt;br /&gt;
Open window &amp;gt; show view &amp;gt; File Explorer&lt;br /&gt;
Select data &amp;gt; local &amp;gt; temp&lt;br /&gt;
Click on &#39;push a file onto folder&#39; button on the right top corner to bring up file select dialog.&lt;br /&gt;
Select audio.3gp&amp;nbsp; created in the local file system. It will be added to data &amp;gt; local &amp;gt; temp in the device.&lt;br /&gt;
&lt;br /&gt;
Change name of the file in code to &quot;data/local/tmp/audio.3gp&quot; &lt;br /&gt;
Now device driver can see the file and your project should run fine.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/8458812112442224744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2011/06/android-mediaplayer-prepare-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/8458812112442224744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/8458812112442224744'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2011/06/android-mediaplayer-prepare-method.html' title='Android: Mediaplayer prepare() method crashes.'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-1418138028902027648</id><published>2011-05-30T21:09:00.000-07:00</published><updated>2011-06-08T16:48:36.596-07:00</updated><title type='text'>Andriod Emulator - Trouble shooting</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Problem:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;When I use MapActivity, I can see grid of the map and zoom controls. But I cannot see the map.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Causes:&lt;br /&gt;
1. You have not set up mapkey in xml file properly. Check &lt;a href=&quot;http://code.google.com/android/add-ons/google-apis/mapkey.html&quot;&gt;this&lt;/a&gt; to find out how.&lt;br /&gt;
or&lt;br /&gt;
2. Your map does not have a default location to show. Set up default location as follows:&lt;br /&gt;
On windows command line, type&lt;br /&gt;
telnet localhost 5554&lt;br /&gt;
geo fix -120.62 35.29&lt;br /&gt;
This will set a location for map to show.&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
3. You do not have internet connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;I cleaned up build and I cannot find R.java anymore&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Causes:&lt;br /&gt;
There should be some error in one of the xml files. Correct it. Once xml files are correct, building project&amp;nbsp; will create R.java automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How can I find logcat on Android emulator&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
Open DDMS by&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
Go to windows &amp;gt; Open Perspective &amp;gt; DDMS&lt;br /&gt;
&lt;br /&gt;
Then open logcat by&lt;br /&gt;
Window &amp;gt; Show view &amp;gt; logcat&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Emulator is taking the whole screen. How can I resize emulator&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Go to Window&amp;gt; Android SDK and AVD Manager&lt;br /&gt;
Select emulator and click on edit.&lt;br /&gt;
Enter width and height at Resolution fields under Skin to set new resolution. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/1418138028902027648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2011/05/andriod-emulator-trouble-shooting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/1418138028902027648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/1418138028902027648'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2011/05/andriod-emulator-trouble-shooting.html' title='Andriod Emulator - Trouble shooting'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-4938114361432948631</id><published>2011-05-27T11:36:00.000-07:00</published><updated>2011-05-27T13:01:48.696-07:00</updated><title type='text'>Android error: error: Error: No resource found that matches the given name (at &#39;drawable&#39; with value &#39;@drawable/....&#39;).</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I have been getting this error and I could not figure out what is the problem. Finally figured out the reason. &lt;br /&gt;
&lt;br /&gt;
This error means that R.java does not have a reference to the image file in question.&lt;br /&gt;
Check R.java under gen folder and find out&amp;nbsp; if it has a location reference to the image file you added.&amp;nbsp; If it does not, these are the possible reasons.&lt;br /&gt;
&lt;br /&gt;
1. You forgot to add image file to res drawable folder&lt;br /&gt;
2. You added image file to a wrong drawable folder. There are three drawable directories, namely&lt;br /&gt;
drawable-hdpi, drawable-ldpi, drawable-mdpi. Try to add image to all three directories and one of them will work depending on the resolution size of your image.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.&amp;nbsp; You have another file in the folder with the same name. Rename one of them so that there are no name conflicts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/4938114361432948631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2011/05/android-error-error-error-no-resource.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/4938114361432948631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/4938114361432948631'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2011/05/android-error-error-error-no-resource.html' title='Android error: error: Error: No resource found that matches the given name (at &#39;drawable&#39; with value &#39;@drawable/....&#39;).'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-8030809680500902993</id><published>2011-04-19T21:12:00.000-07:00</published><updated>2011-04-19T21:12:04.635-07:00</updated><title type='text'>Rational Functional Tester- isEnabled() method on buttons throws exception.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Problem: When using isEnabled method on a button disabled already throws ObjectNotFound exception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution: Use buttonname(null,DISABLED).isEnabled() instead of buttonname().isEnabled()  &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/8030809680500902993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2011/04/rational-functional-tester-isenabled.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/8030809680500902993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/8030809680500902993'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2011/04/rational-functional-tester-isenabled.html' title='Rational Functional Tester- isEnabled() method on buttons throws exception.'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-3906896727750828618</id><published>2011-03-20T18:43:00.000-07:00</published><updated>2011-03-20T18:43:29.276-07:00</updated><title type='text'>SMTP trouble shooting : error 500 5.5.1 &quot;Command unrecognized&quot;</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I am able to set up connection with mail server .I get response from mail server while&amp;nbsp;sending HELO message. But I get  error 500 5.5.1 Command unrecognized&quot;&quot;&amp;nbsp; when I send all other messages. I am sure it is not syntax error that causing the problem. &lt;br /&gt;
&lt;br /&gt;
Solution :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Try appending your messages with carriage return and line feed.&lt;br /&gt;
Example,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&quot;HELO mailserver_name\r\n&quot;;&lt;br /&gt;
&quot;MAIL FROM:&lt;myemail@mysite.com&gt;\r\n&quot;;&lt;/myemail@mysite.com&gt;&lt;br /&gt;
&quot;RCPT TO:&lt;youremail@mailserver.com&gt;\r\n&quot;&amp;nbsp; &lt;/youremail@mailserver.com&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In SMTP, error messages starting with 500 is due to syntax errors in messages sent. Focus on the message you are sending while you are debugging.If that does not work, using telnet, try to send the same messages and make sure that mail server responds correctly. Refer &lt;a href=&quot;http://tools.ietf.org/html/rfc821&quot;&gt;RFC 821&lt;/a&gt; for further reference.&lt;/div&gt;&lt;br /&gt;
REPLY CODES BY FUNCTION GROUPS&lt;br /&gt;
&lt;br /&gt;
500 Syntax error, command unrecognized&lt;br /&gt;
[This may include errors such as command line too long]&lt;br /&gt;
501 Syntax error in parameters or arguments&lt;br /&gt;
502 Command not implemented&lt;br /&gt;
503 Bad sequence of commands&lt;br /&gt;
504 Command parameter not implemented&lt;br /&gt;
&lt;br /&gt;
211 System status, or system help reply&lt;br /&gt;
214 Help message&lt;br /&gt;
[Information on how to use the receiver or the meaning of a&lt;br /&gt;
particular non-standard command; this reply is useful only&lt;br /&gt;
to the human user]&lt;br /&gt;
&lt;br /&gt;
220 &lt;domain&gt; Service ready&lt;br /&gt;
221 &lt;domain&gt; Service closing transmission channel&lt;br /&gt;
421 &lt;domain&gt; Service not available,&lt;br /&gt;
closing transmission channel&lt;br /&gt;
[This may be a reply to any command if the service knows it&lt;br /&gt;
must shut down]&lt;br /&gt;
&lt;br /&gt;
250 Requested mail action okay, completed&lt;br /&gt;
251 User not local; will forward to &lt;forward-path&gt;&lt;br /&gt;
450 Requested mail action not taken: mailbox unavailable&lt;br /&gt;
[E.g., mailbox busy]&lt;br /&gt;
550 Requested action not taken: mailbox unavailable&lt;br /&gt;
[E.g., mailbox not found, no access]&lt;br /&gt;
451 Requested action aborted: error in processing&lt;br /&gt;
551 User not local; please try &lt;forward-path&gt;&lt;br /&gt;
452 Requested action not taken: insufficient system storage&lt;br /&gt;
552 Requested mail action aborted: exceeded storage allocation&lt;br /&gt;
553 Requested action not taken: mailbox name not allowed&lt;br /&gt;
[E.g., mailbox syntax incorrect]&lt;br /&gt;
354 Start mail input; end with &lt;crlf&gt;.&lt;crlf&gt;&lt;br /&gt;
554 Transaction failed&lt;br /&gt;
&lt;/crlf&gt;&lt;/crlf&gt;&lt;/forward-path&gt;&lt;/forward-path&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/domain&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/3906896727750828618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2011/03/smtp-trouble-shooting-error-500-551.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/3906896727750828618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/3906896727750828618'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2011/03/smtp-trouble-shooting-error-500-551.html' title='SMTP trouble shooting : error 500 5.5.1 &quot;Command unrecognized&quot;'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-8927221383057673044</id><published>2011-02-12T14:15:00.000-08:00</published><updated>2011-02-12T14:15:12.990-08:00</updated><title type='text'>How to set environmental variables in windows XP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;Note: Following procedures set system environmental variables permanently. For temporary settings use &#39;set name=value&#39; in command line.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Option 1&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Right click on My Computer.&lt;br /&gt;
Select properties.&lt;br /&gt;
Click on Advanced tab&lt;br /&gt;
Click on Environmental variables&lt;br /&gt;
Click on new under system variables&lt;br /&gt;
Enter name and value of environmental variable&lt;br /&gt;
Click ok.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Option 2&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Click on Start &amp;gt; Control Panel &amp;gt; System&lt;br /&gt;
A window opens.&lt;br /&gt;
Click on Advanced tab&lt;br /&gt;
Click on Environmental variables&lt;br /&gt;
Click on new under system variables&lt;br /&gt;
Enter name and value of environmental variable&lt;br /&gt;
Click ok.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/8927221383057673044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2011/02/how-to-set-environmental-variables-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/8927221383057673044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/8927221383057673044'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2011/02/how-to-set-environmental-variables-in.html' title='How to set environmental variables in windows XP'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-6950697085849233749</id><published>2010-12-07T21:33:00.000-08:00</published><updated>2010-12-07T21:54:07.945-08:00</updated><title type='text'>Logical and Vector Timestamps in Distributed Systems - Example</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&amp;nbsp;Logical Time Stamp&lt;br /&gt;
&lt;br /&gt;
Example 1&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6kQwzliZ1XVRhd0GRZ33W6PeO7J1SWpcxVAZGuTH_qRBOs11BMNqNTs0fRSk6cbeUr28D2TI0Wternneke3SCevklGXZ5qy_79XCLgvjjTD1zgVyrtpNY3P5BHkKLpenQrKRcdMyhsre7/s1600/LC1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6kQwzliZ1XVRhd0GRZ33W6PeO7J1SWpcxVAZGuTH_qRBOs11BMNqNTs0fRSk6cbeUr28D2TI0Wternneke3SCevklGXZ5qy_79XCLgvjjTD1zgVyrtpNY3P5BHkKLpenQrKRcdMyhsre7/s320/LC1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vector Timestamps&lt;br /&gt;
Example 1&amp;nbsp; &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDhZHkrH-HKF_TGyg3lrDsyr2Zp3qSPPfUwklXw26NWgTx0LFvSgvoTFEan5mHhAp63tDUOTxGM3urCjpTSthlV3mL237zvdMKUw93SAdVQlRvQqYeKRfEtUuklr4sUGBDHhib1V3P6voW/s1600/VC1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDhZHkrH-HKF_TGyg3lrDsyr2Zp3qSPPfUwklXw26NWgTx0LFvSgvoTFEan5mHhAp63tDUOTxGM3urCjpTSthlV3mL237zvdMKUw93SAdVQlRvQqYeKRfEtUuklr4sUGBDHhib1V3P6voW/s320/VC1.JPG&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example 2&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdMosIqhjSXMhF7uorlvCbC4ZjqMtLFVAppKSYMQmoPnadDx_e1Kzi5gGdc6UOdYQK9STo-1C-VuxFerzPZcbGl0GQyvKAWLnBcR6D0aw1TIHtXGJnW3IcQm_7Shnk4b1e9-977oCFUdV_/s1600/vc2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;186&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdMosIqhjSXMhF7uorlvCbC4ZjqMtLFVAppKSYMQmoPnadDx_e1Kzi5gGdc6UOdYQK9STo-1C-VuxFerzPZcbGl0GQyvKAWLnBcR6D0aw1TIHtXGJnW3IcQm_7Shnk4b1e9-977oCFUdV_/s320/vc2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/6950697085849233749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/12/logical-and-vector-timestamps-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/6950697085849233749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/6950697085849233749'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/12/logical-and-vector-timestamps-in.html' title='Logical and Vector Timestamps in Distributed Systems - Example'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6kQwzliZ1XVRhd0GRZ33W6PeO7J1SWpcxVAZGuTH_qRBOs11BMNqNTs0fRSk6cbeUr28D2TI0Wternneke3SCevklGXZ5qy_79XCLgvjjTD1zgVyrtpNY3P5BHkKLpenQrKRcdMyhsre7/s72-c/LC1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-1556358462825355631</id><published>2010-12-03T22:27:00.000-08:00</published><updated>2010-12-03T22:27:02.820-08:00</updated><title type='text'>Simple MapReduce Program Example in Python</title><content type='html'>&lt;b&gt;Given a set of integers, compute the sum of their square values.&lt;/b&gt;&lt;br /&gt;
(Assumption: You already know how to run a map reduce program using an input file and how to check the output)&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;mapper.py&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
&lt;br /&gt;
# input comes from STDIN (standard input)&lt;br /&gt;
for line in sys.stdin:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; # remove leading and trailing whitespace&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; line = line.strip()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; # split the line into numbers&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; numbers = line.split()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; for number in numbers:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; num = int(number)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; square = num*num&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &#39;%s\t%s&#39; % (1,square)&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;reducer.py&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
&lt;br /&gt;
#sum initialized to zero&lt;br /&gt;
sum=0&lt;br /&gt;
# input comes from STDIN&lt;br /&gt;
for line in sys.stdin:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; # remove leading and trailing whitespace&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; line = line.strip()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; # parse the input we got from mapper.py&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; word, square = line.split(&#39;\t&#39;, 1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; # convert square(currently a string) to int&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; square = int(square)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum=sum+square&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; except ValueError:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # count was not a number, so silently&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # ignore/discard this line&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;br /&gt;
#print sum of squares&lt;br /&gt;
print &#39;%s&#39;% (sum)&lt;br /&gt;
___________________________________________________________________&lt;br /&gt;
input.txt&lt;br /&gt;
1 2 3 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
output/part-0000&lt;br /&gt;
30</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/1556358462825355631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/12/simple-mapreduce-program-example-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/1556358462825355631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/1556358462825355631'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/12/simple-mapreduce-program-example-in.html' title='Simple MapReduce Program Example in Python'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-3480588302665674104</id><published>2010-12-03T09:49:00.000-08:00</published><updated>2010-12-03T09:49:07.519-08:00</updated><title type='text'>NP completeness exam questions</title><content type='html'>Consider a reduction of problem A to problem B. What is the most precise claim you&lt;br /&gt;
can make about problem B for each of the following situations?&lt;br /&gt;
&lt;br /&gt;
a) A is NP-complete and the reduction is in polynomial time.&lt;br /&gt;
&amp;nbsp;NP-hard. (At least as hard as NP-complete problem.)&lt;br /&gt;
&lt;br /&gt;
b) A is in polynomial time and the reduction is also in polynomial time.&lt;br /&gt;
B could be anything.&lt;br /&gt;
&lt;br /&gt;
c) A is NP-complete and the reduction is in Pspace.&lt;br /&gt;
B could be anything.&lt;br /&gt;
&lt;br /&gt;
d) A is in nondeterministic polynomial time and the reduction is in polynomial time.&lt;br /&gt;
B is at least as hard as A, but nothing more can be said.&lt;br /&gt;
&lt;br /&gt;
e) A requires exponential time and the reduction is in polynomial time.&lt;br /&gt;
B must requires polynomial time for deciding.&lt;br /&gt;
&lt;br /&gt;
f) A is Pspace complete and the reduction is in Pspace.&lt;br /&gt;
B could be anything.&lt;br /&gt;
_______________________________________________________________________&lt;br /&gt;
Suppose you could reduce an NP complete problem to a polynomial time problem in&lt;br /&gt;
polynomial time. What would be the consequence?&lt;br /&gt;
What if the reduction required exponential time?&lt;br /&gt;
&lt;br /&gt;
If we could reduce an NP-complete problem to a problem in P, then NP will&lt;br /&gt;
be equal to P. If the reduction required exponential time, then there is not&lt;br /&gt;
special consequence. (In fact any NP-complete problem can be reduced to&lt;br /&gt;
a polynomial time solvable problem using exponential time reduction.)&lt;br /&gt;
_______________________________________________________________________</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/3480588302665674104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/12/np-completeness-exam-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/3480588302665674104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/3480588302665674104'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/12/np-completeness-exam-questions.html' title='NP completeness exam questions'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-4009916348763405285</id><published>2010-12-01T15:26:00.000-08:00</published><updated>2010-12-01T21:10:11.812-08:00</updated><title type='text'>True-Sat problem is NP-complete</title><content type='html'>&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/span&gt;TRUE-SAT = {boolean expressions E in conjunctive normal form that   &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (1) are true when all variables are set true, AND ALSO&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (2) have some other truth assignment that makes E true}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This can also be stated (in Garey-Johnson notation) as:   &lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Instance:&lt;/b&gt; Set of clauses C&lt;sub&gt;1&lt;/sub&gt;,C&lt;sub&gt;2&lt;/sub&gt;,....C&lt;sub&gt;k&lt;/sub&gt; over the boolean variables u&lt;sub&gt;1&lt;/sub&gt;,u&lt;sub&gt;2&lt;/sub&gt;,....u&lt;sub&gt;m&lt;/sub&gt;     &lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Question:&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (1) are all C&lt;sub&gt;i&lt;/sub&gt; true when u&lt;sub&gt;1&lt;/sub&gt;,u&lt;sub&gt;2&lt;/sub&gt;,....u&lt;sub&gt;m&lt;/sub&gt; are set to true, and&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (2) is there another satisfying truth assignment (not all variables set to true)?       &lt;br /&gt;
&lt;br /&gt;
&lt;dir&gt;&lt;dir&gt;   &lt;/dir&gt; &lt;/dir&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
First, Show TRUE_SAT is in NP. (This is left as an exercise)&lt;br /&gt;
&lt;u&gt;Then show TRUE-SAT is NP-hard.&lt;/u&gt;&lt;br /&gt;
If an expression is not true when all variables are true, then it is surely not in TRUE-SAT. &lt;br /&gt;
&lt;br /&gt;
To show TRUE-SAT is NP-complete, we reduce SAT to it. Suppose we are given an expression &lt;i&gt;E&lt;/i&gt; with variables &lt;i&gt;a,b,c&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
Convert &lt;i&gt;E&lt;/i&gt; to &lt;i&gt;E&#39;&lt;/i&gt; as follows:&lt;br /&gt;
Test if &lt;i&gt;E&lt;/i&gt; is true when a = T, b=T and c=T.&lt;br /&gt;
If so, we know &lt;i&gt;E&lt;/i&gt; is satisfiable, then add (a U a&#39;) to E.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; E&#39; = E&amp;nbsp; U ( a&lt;b&gt; U&lt;/b&gt; a&#39; )&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // E satisfies first condition. a &lt;b&gt;U&lt;/b&gt; a&#39; satisfies the second condition. &lt;br /&gt;
Otherwise&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; E&#39; = E &lt;b&gt;U&lt;/b&gt; (&amp;nbsp; a &lt;b&gt;U&lt;/b&gt; b&lt;b&gt; U&lt;/b&gt; c )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Adding&amp;nbsp; a &lt;b&gt;U&lt;/b&gt; b&lt;b&gt; U&lt;/b&gt; c satisfies first condition. If E is in SAT, that satisfies the second condition.&lt;br /&gt;
&amp;nbsp;Therefore, TRUE_SAT accepts only when E is in SAT. Hence TRUE-SAT is reducible to SAT and TRUE-SAT is NP-complete.</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/4009916348763405285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/12/true-sat-problem-is-np-complete.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/4009916348763405285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/4009916348763405285'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/12/true-sat-problem-is-np-complete.html' title='True-Sat problem is NP-complete'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-8563726901083139867</id><published>2010-11-29T12:09:00.000-08:00</published><updated>2010-11-29T12:09:07.921-08:00</updated><title type='text'>PageRank Algorithm Using Mapreduce</title><content type='html'>&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&amp;nbsp; -&amp;nbsp; &lt;a href=&quot;http://en.wikipedia.org/wiki/PageRank&quot;&gt;http://en.wikipedia.org/wiki/PageRank&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Examples of pagerank calculation&lt;/b&gt; - &lt;a href=&quot;http://pagerank.suchmaschinen-doktor.de/index/examples.html&quot;&gt;http://pagerank.suchmaschinen-doktor.de/index/examples.html&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Formula for pagerank calculation:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;A&quot;&gt;&lt;b&gt;PR(A) = (1 - d) + d * SUM ((PR(I-&amp;gt;A)/C(I))&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;A&quot;&gt;Where:&lt;/div&gt;&lt;ul class=&quot;A&quot;&gt;&lt;li&gt;PR(A) is the PageRank of your page A.&lt;/li&gt;
&lt;li&gt;d is the damping factor, usually set to 0,85. &lt;/li&gt;
&lt;li&gt;PR(I-&amp;gt;A) is the PageRank of page I containing a link to                  page A.&lt;/li&gt;
&lt;li&gt;C(I) is the number of links off page I.&lt;/li&gt;
&lt;li&gt;PR(I-&amp;gt;A)/C(I) is a PR-value page A receives from page I.&lt;/li&gt;
&lt;li&gt;SUM (PR(I-&amp;gt;A)/C(I)) is the sum of all PR-values page A receives                  from pages with links to page A..&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;Inputs and Outputs of Mapper and Reducer&lt;/b&gt; - &lt;a href=&quot;https://wiki.umiacs.umd.edu/ccc/images/e/ea/CLuE-Jagannathan.pdf&quot;&gt;https://wiki.umiacs.umd.edu/ccc/images/e/ea/CLuE-Jagannathan.pdf&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Video lecture &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;385&quot; width=&quot;480&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/BT-piFBP4fE?fs=1&amp;amp;hl=en_US&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/BT-piFBP4fE?fs=1&amp;amp;hl=en_US&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;480&quot; height=&quot;385&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/8563726901083139867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/11/pagerank-algorithm-using-mapreduce.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/8563726901083139867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/8563726901083139867'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/11/pagerank-algorithm-using-mapreduce.html' title='PageRank Algorithm Using Mapreduce'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-1880526770640654310</id><published>2010-11-25T14:54:00.000-08:00</published><updated>2010-11-25T14:54:12.235-08:00</updated><title type='text'>Factorization of a Number is in NP. Why?</title><content type='html'>Factoring a number seems to be trivial. The fact is that factorization when done in binary takes non-polynomial time.&lt;br /&gt;
&lt;br /&gt;
For more information check http://en.wikipedia.org/wiki/Integer_factorization</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/1880526770640654310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/11/factorization-of-number-is-in-np-why.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/1880526770640654310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/1880526770640654310'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/11/factorization-of-number-is-in-np-why.html' title='Factorization of a Number is in NP. Why?'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-2418200304224945426</id><published>2010-11-17T22:30:00.000-08:00</published><updated>2010-11-17T22:30:32.495-08:00</updated><title type='text'>Polynomial Reduction Example</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Show that WRITE_ONE&lt;sub&gt;TM&lt;/sub&gt; = {&lt;i&gt;M&lt;/i&gt; : &lt;i&gt;M&lt;/i&gt; is a Turing machine that writes a 1 on its tape } is undecidable.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Let us assume that WRITE_ONE&lt;sub&gt;TM&lt;/sub&gt; is decidable. Then there exists a Turing machine WRITE_ONE&lt;sub&gt;TM&lt;/sub&gt;, &amp;nbsp;which can tell you if a given Turing Machine M will write a 1 on its tape on input z.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Let us look at how WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;&amp;nbsp;works. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;M is the input to WRITE_ONE&lt;sub&gt;TM .&lt;/sub&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;If M writes a 1 on its tape , WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;&amp;nbsp;accepts. &amp;nbsp;– Yes instance&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;If M does not write a 1 on its tape, WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;&amp;nbsp;rejects. – No instance.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;If M writes a 1 on its tape at any time of its computation, WRITE_ONE&lt;sub&gt;TM&lt;/sub&gt; decides yes. It does not matter what M does before it writes 1 on its tape. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&amp;nbsp;M might have 10000 transitions before it writes 1 on its tape. Still WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;should be able to decide whether M will write 1 on its tape. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;M might compute what is 5+7 before it writes 1 on its tape. Still WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;should be able to decide whether M will write 1 on its tape. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;M can watch a youtube video and then write a 1 on its tape. Still WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;should be able to decide whether M will write 1 on its tape. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;( just kidding)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;M might simulate another Turing Machine and then write a 1 on its tape. Still WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;should be able to decide whether M will write a1 on its tape. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Suppose M is simulating another machine T on input w on M’s tapes and if T accepts w, M is writing a 1 on its tape. Still WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;should be able to decide whether M will write a1 on its tape. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Did you hear that?&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Isn’t that a solution to decidability of A&lt;sub&gt;TM.&lt;/sub&gt; Whenever you have to decide if a TM T will accept or reject w, all you have to do is:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Construct a new TM, M such that&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-left: 0.75in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; font-size: 14pt;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;It simulates T on input w on M’s tape&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 0.75in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; font-size: 14pt;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;If T accepts w, write a 1 on M’s tape.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: 0.75in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; font-size: 14pt;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Feed M to WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;margin-left: 0.75in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol; font-size: 14pt;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;If WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;decides yes, T accepts w.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;But we already know that A&lt;sub&gt;TM&lt;/sub&gt; is undecidable. So it is not possible that WRITE_ONE&lt;sub&gt;TM &lt;/sub&gt;&amp;nbsp;can be decidable if it can solve A&lt;sub&gt;TM&lt;/sub&gt;. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Hence WRITE_ONE&lt;sub&gt;TM &amp;nbsp;&lt;/sub&gt;is undecidable.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 0.75in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/2418200304224945426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/11/polynomial-reduction-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/2418200304224945426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/2418200304224945426'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/11/polynomial-reduction-example.html' title='Polynomial Reduction Example'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-9025021953027349415</id><published>2010-11-02T11:49:00.000-07:00</published><updated>2010-11-02T11:49:26.096-07:00</updated><title type='text'>Number of full nodes in a binary tree  c++</title><content type='html'>A FULL node in a binary tree is a node that has exactly two non-null  children. Write a RECURSIVE function that returns  the number of full nodes in a binary tree.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# include &amp;lt;iostream &amp;gt;&lt;br /&gt;
#include&amp;nbsp; &amp;lt;stdio.h &amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;/stdio.h&gt;&lt;/stdio.h&gt;&lt;/iostream&gt;&lt;br /&gt;
&lt;br /&gt;
struct TreeNode{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int value;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeNode* left;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeNode* right;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;int FullNodes(TreeNode* root){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(root == NULL)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //if tree is empty&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(root-&amp;gt;left == NULL &amp;amp;&amp;amp; root-&amp;gt;right == NULL)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //leaf nodes&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(root-&amp;gt;left!=NULL &amp;amp;&amp;amp; root-&amp;gt;right != NULL)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Full Nodes&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return 1 + FullNodes(root-&amp;gt;left) + FullNodes(root-&amp;gt;right);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(root-&amp;gt;left==NULL &amp;amp;&amp;amp; root-&amp;gt;right != NULL)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Nodes with no left child&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return FullNodes(root-&amp;gt;right);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(root-&amp;gt;left!=NULL &amp;amp;&amp;amp; root-&amp;gt;right == NULL)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Nodes with no right child&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return FullNodes(root-&amp;gt;left);&lt;br /&gt;
&lt;br /&gt;
}&lt;/b&gt;&lt;br /&gt;
/*---------------------------------TEST---------------------------------*/&lt;br /&gt;
&lt;br /&gt;
//Function to insert into binary tree&lt;br /&gt;
void insert(TreeNode*&amp;amp; root, int num){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(root == NULL){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; root = new TreeNode();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; root-&amp;gt;value = num;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; root-&amp;gt;left = NULL;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; root-&amp;gt;right = NULL;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else if(num &amp;lt; root-&amp;gt;value){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; insert(root-&amp;gt;left,num);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; insert(root-&amp;gt;right,num);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main(){&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//creates a tree&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeNode* tree = NULL;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; insert(tree, 8);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; insert(tree, 5);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; insert(tree,10);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; insert(tree, 3);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; insert(tree, 9);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; insert(tree, 6);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//Full Node count test&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cout &amp;lt;&amp;lt; FullNodes(tree); //8 and 5 are full nodes . So output is 2&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/9025021953027349415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/11/number-of-full-nodes-in-binary-tree-c.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/9025021953027349415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/9025021953027349415'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/11/number-of-full-nodes-in-binary-tree-c.html' title='Number of full nodes in a binary tree  c++'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-4622074900385020244</id><published>2010-10-18T10:48:00.000-07:00</published><updated>2010-10-27T12:41:29.077-07:00</updated><title type='text'>MPI Programming Exam Questions</title><content type='html'>&lt;b&gt;Feel free to give answers to unanswered questions as comments&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.&amp;nbsp; &lt;b&gt;&lt;a href=&quot;http://people.sc.fsu.edu/%7Ejburkardt/presentations/fdi_2008_lecture8.pdf#page=16&quot;&gt;Sum of prime factors :&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;  http://people.sc.fsu.edu/%7Ejburkardt/presentations/fdi_2008_lecture8.pdf#page=16&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Add up the prime numbers from 2 to N.&lt;br /&gt;
Each of P processors will simply take about 1/P of the range of&lt;br /&gt;
numbers to check, and add up the primes locally.&lt;br /&gt;
When it&#39;s done, it will send the partial result to processor 0.&lt;br /&gt;
&lt;br /&gt;
2.&amp;nbsp; Deadlock avoidance when using blocking send and receive in order.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.cs.ucsb.edu/%7Ehnielsen/cs140/mpi-deadlocks.html&quot;&gt; http://www.cs.ucsb.edu/~hnielsen/cs140/mpi-deadlocks.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5CMCHEEN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5CMCHEEN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;
	mso-fareast-language:EN-US;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-size:10.0pt;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
 /* List Definitions */
 @list l0
	{mso-list-id:904489258;
	mso-list-type:hybrid;
	mso-list-template-ids:-1783853930 -301066920 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:;
	mso-level-tab-stop:1.0in;
	mso-level-number-position:left;
	margin-left:1.0in;
	text-indent:-.25in;
	font-family:Symbol;}
@list l1
	{mso-list-id:1108349071;
	mso-list-type:hybrid;
	mso-list-template-ids:-994933528 1210846812 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
	{mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--&gt; 
&lt;/style&gt;&lt;br /&gt;
&lt;ol start=&quot;3&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&amp;nbsp;In      MPI, when does a non-blocking recv message return?&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;ol start=&quot;4&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&amp;nbsp;What      is an MPI communicator?&amp;nbsp;&amp;nbsp; What is      MPI_COMM_WORLD?&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Two processors must be in a common &quot;communicator group&quot; in order to communicate. This is simply&amp;nbsp; a way for the user to organize&amp;nbsp; processors into sub-groups. All processors can communicate in the&lt;br /&gt;
shared group known as MPI_COMM_WORLD.&lt;/div&gt;&lt;ol start=&quot;5&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&amp;nbsp;In      MPI, what is a process rank?&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;ol start=&quot;6&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&amp;nbsp;True      or false:&amp;nbsp; In MPI you set the number      of processes when you write the source code.&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; No. Number of processes are given on execution.&lt;/div&gt;&lt;ol start=&quot;7&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&amp;nbsp;Give      a short piece of pseudocode that illustrates the master/slave programming      model.&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;8&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&amp;nbsp;Explain      if the following MPI code segment is correct or not, and why: &lt;br /&gt;
Process 0 executes: &lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;MPI_Recv(&amp;amp;yourdata, 1, MPI_FLOAT, 1, tag, MPI_COMM_WORLD, &amp;amp;status); &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;MPI_Send(&amp;amp;mydata, 1, MPI_FLOAT, 1, tag, MPI_COMM_WORLD); &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in;&quot;&gt;Process 1 executes: &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;MPI_Recv(&amp;amp;yourdata, 1, MPI_FLOAT, 0, tag,MPI_COMM_WORLD, &amp;amp;status); &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;MPI_Send(&amp;amp;mydata, 1, MPI_FLOAT, 0, tag, MPI_COMM_WORLD);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Both are blocking receives waiting for each other to send. System is deadlocked.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;ol start=&quot;9&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&amp;nbsp;Suppose      that process 0 has variable A, and process 1 also has a variable A. Write      MPI-like pseudocode to exchange these values between the processes.&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; P0:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; send(P1,A)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; recieve(P0,A)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; P1:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; recieve(P1,A)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; send(P0,A)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;10&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&amp;nbsp;Explain the purpose of each of the library calls listed. &lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Init &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Finalize &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Comm_rank &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Comm_size &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Send &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Recv &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Barrier &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Bcast &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Scatter &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Gather &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 1in; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;·&lt;span style=&quot;font: 7pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;MPI_Reduce&lt;/div&gt;&lt;ol start=&quot;11&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&amp;nbsp;What      is an MPI derived datatype and when would you use one?&amp;nbsp; Give an example.&amp;nbsp;&lt;/li&gt;
Derived datatypes are datatypes that are built from the basic MPI datatypes.
&lt;li class=&quot;MsoNormal&quot;&gt; In      MPI, when does a blocking recv message return?&lt;div class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Blocks until it receives message&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;True      or false:&amp;nbsp; You can write a program      using MPI that  will run across all of the cores of your multicore computer      in  parallel.&amp;nbsp; Also, if this is      possible, indicate if you think this is  a good way to write the      program.&amp;nbsp; You must justify your       answer to receive credit.&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;Discuss marshalling in MPI.&lt;/li&gt;
http://books.google.com/books?id=LLdekoUxmr0C&amp;amp;pg=PA86&amp;amp;lpg=PA86&amp;amp;dq=MPI+marshalling&amp;amp;source=bl&amp;amp;ots=aLn5ivDP2i&amp;amp;sig=ElkL0CwR55hVES-tQJjoAKBIIaI&amp;amp;hl=en&amp;amp;ei=U3nITNq7NYrAsAPqytW9DQ&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=10&amp;amp;ved=0CE0Q6AEwCQ#v=onepage&amp;amp;q=MPI%20marshalling&amp;amp;f=false
&lt;li class=&quot;MsoNormal&quot;&gt;When does a blocking send return.&lt;/li&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;/div&gt;&lt;/ol&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MPI uses buffering by default. Send returns when message is saved in receivers buffer. Process calling&amp;nbsp; MPI_Send can continue even if destination has not received the message.&lt;br /&gt;
&lt;br /&gt;
16. Programming question 1 : &lt;a href=&quot;http://www.cs.usfca.edu/%7Epeter/cs220/mt1_old_key.pdf&quot;&gt;http://www.cs.usfca.edu/~peter/cs220/mt1_old_key#page=6.pdf&lt;/a&gt;&lt;br /&gt;
17.&amp;nbsp; Programming question2 :&amp;nbsp; &lt;a href=&quot;http://www.cs.usfca.edu/%7Epeter/cs220/mt1_key#page=4.pdf&quot;&gt;http://www.cs.usfca.edu/~peter/cs220/mt1_key#page=4.pdf&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.cs.usfca.edu/%7Epeter/cs220/mt1_keypage=4.pdf&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol start=&quot;11&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/4622074900385020244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/10/mpi-programming-examples.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/4622074900385020244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/4622074900385020244'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/10/mpi-programming-examples.html' title='MPI Programming Exam Questions'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-4867232885982926401</id><published>2010-10-06T23:16:00.000-07:00</published><updated>2010-10-06T23:16:43.370-07:00</updated><title type='text'>3 bit up counter using D flipflops</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEdMW_Pjvka7QVXLgJPHGzWdPZfpcizD8gzc8KVt9Ca8qvG1pISYm5OM3onYN1ctsqFNLFCNl6QplFA8onrNoz76bYe4_R8i6PBwtFO4CQq2CQ_nHpTVU_glxpMYJfc1ArmI71Nm2hyphenhyphenWHO/s1600/3bitcounter.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;473&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEdMW_Pjvka7QVXLgJPHGzWdPZfpcizD8gzc8KVt9Ca8qvG1pISYm5OM3onYN1ctsqFNLFCNl6QplFA8onrNoz76bYe4_R8i6PBwtFO4CQq2CQ_nHpTVU_glxpMYJfc1ArmI71Nm2hyphenhyphenWHO/s640/3bitcounter.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/4867232885982926401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/10/3-bit-up-counter-using-d-flipflops.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/4867232885982926401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/4867232885982926401'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/10/3-bit-up-counter-using-d-flipflops.html' title='3 bit up counter using D flipflops'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEdMW_Pjvka7QVXLgJPHGzWdPZfpcizD8gzc8KVt9Ca8qvG1pISYm5OM3onYN1ctsqFNLFCNl6QplFA8onrNoz76bYe4_R8i6PBwtFO4CQq2CQ_nHpTVU_glxpMYJfc1ArmI71Nm2hyphenhyphenWHO/s72-c/3bitcounter.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-4406301548729977617</id><published>2010-09-29T12:08:00.000-07:00</published><updated>2010-10-13T15:57:49.150-07:00</updated><title type='text'>Memory management  questions</title><content type='html'>&lt;b&gt;Assume you have a small virtual address space of size 64 KB. Further assume that this is a system&lt;br /&gt;
that uses paging and that each page is of size 8 KB.&lt;br /&gt;
(a) How many bits are in a virtual address in this system?&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
16 (1-KB of address space needs 10 bits, and 64 needs 6; thus 16).&lt;br /&gt;
&lt;br /&gt;
(b) &lt;b&gt;Recall that with paging, a virtual address is usually split into two components: a virtual page number (VPN) and an offset. How many bits are in the VPN?&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
3. Only eight 8-KB pages in a 64-KB address space.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(c) How many bits are in the offset?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
16 (VA) - 3 (VPN) = 13.&lt;br /&gt;
Alternately: an 8KB page of course requires 13 bits to address each byte (213 = 8192).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(d) Now assume that the OS is using a linear page table, as discussed in class. How many entries does this linear page table contain?&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
One entry per virtual page. Thus, 8.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Now assume you again have a small virtual address space of size 64 KB, that the system again uses paging, but&lt;br /&gt;
that each page is of size 4 bytes (note: not KB!).&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(a) How many bits are in a virtual address in this system?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Still 16. The address space is the same size.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(b) How many bits are in the VPN?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
14.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(c) How many bits are in the offset?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Just 2 (4 bytes).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(d) Again assume that the OS is using a linear page table. How many entries does this linear page table&lt;br /&gt;
contain?&lt;/b&gt;&lt;br /&gt;
2**14, or 16,384.&lt;br /&gt;
____________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Consider the following segment table: &lt;br /&gt;
&lt;pre&gt;Segment  Base  Length
    0   219    600
    1  2300     14
    2    90    100
    3  1327    580
    4  1952     96&lt;/pre&gt;What are the physical addressed for the following logical addresses?&lt;br /&gt;
&lt;dl&gt;&lt;dd&gt;(a) 0,430 &lt;/dd&gt;&lt;dd&gt;(b) 1,10 &lt;/dd&gt;&lt;dd&gt;(c) 2,500 &lt;/dd&gt;&lt;dd&gt;(d) 3,400 &lt;/dd&gt;&lt;dd&gt;(e) 4,112 &lt;/dd&gt;&lt;/dl&gt;&lt;ul&gt;&lt;li&gt;(a) 219 + 430 = 649 &lt;/li&gt;
&lt;li&gt;(b) 2300 + 10 = 2310 &lt;/li&gt;
&lt;li&gt;(c) illegal reference; traps to operating system &lt;/li&gt;
&lt;li&gt;(d) 1327 + 400 = 1727 &lt;/li&gt;
&lt;li&gt;(e) illegal reference; traps to operating system&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
___________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Consider a paging system with the page table stored in memory. &lt;br /&gt;
&lt;dl&gt;&lt;dd&gt;(a) If a memory reference takes 200 nanoseconds, how long does a paged  memory reference take?  &lt;/dd&gt;&lt;dd&gt;(b) If we add associative registers, and 75% of all page-table references are  found in the associative registers, what is the effective memory  reference time?  (Assume that finding a page-table entry in the associative  registers takes zero time, if the entry is there.) &lt;/dd&gt;&lt;/dl&gt;&lt;ul&gt;&lt;li&gt;400 nanoseconds.  200 ns to access the page table plus 200 ns to access  the word in memory.  &lt;/li&gt;
&lt;li&gt;250 nanoseconds.  75% of the time it&#39;s 200 ns, and the other 25% of the  time it&#39;s 400ns, so the equation is: &lt;pre&gt;e.a. = (.75*200)+(.25*400)&lt;/pre&gt;________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
A certain computer provides its users with a virtual memory space of 2**32 bytes. The computer has 2**18 bytes of physical memory. The virtual memory is implemented by paging, and the page size is 4K bytes. A user process generated the virtual address 11123456. Explain how the system establishes the corresponding physical location. &lt;br /&gt;
&lt;br /&gt;
* The virtual address in binary form is&lt;br /&gt;
&lt;br /&gt;
0001 0001 0001 0010 0011 0100 0101 0110&lt;br /&gt;
&lt;br /&gt;
Since the page size is 2**12, the page table size is 2**20. Therefore, the low-order 12 bits (0100 0101 0110) are used as the displacement into the page, while the remaining 20 bits (0001 0001 0001 0010 0011) are used as the displacement in the page table. &lt;br /&gt;
&lt;br /&gt;
__________________________________________________________________________________&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/4406301548729977617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/09/virtual-memory-questions.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/4406301548729977617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/4406301548729977617'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/09/virtual-memory-questions.html' title='Memory management  questions'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-1869632678715240482</id><published>2010-09-29T11:53:00.000-07:00</published><updated>2010-10-05T00:02:20.914-07:00</updated><title type='text'>Round robin scheduling questions</title><content type='html'>1. Consider N processes sharing the CPU in a round-robin fashion (N&amp;gt;=2). Assume that each context switch takes S msec and that each time quantum is Q msec. For simplicity, assume that processes never block on any event and simply switch between the CPU and the ready queue.&lt;br /&gt;
&lt;br /&gt;
In the following your answers should be functions of N, S and T.&lt;br /&gt;
&lt;br /&gt;
a) Find the maximum value of Q such that no process will ever go more than T msec&lt;br /&gt;
&lt;br /&gt;
Time taken for one process per quantum = quantum,Q+context switch,S&lt;br /&gt;
&lt;br /&gt;
Max wait time, T = N(Q+S)&lt;br /&gt;
&lt;br /&gt;
T = NQ+NS&lt;br /&gt;
Q = (T-NS)/N&lt;br /&gt;
&lt;br /&gt;
b) Find the maximum value of Q such that no process will ever go more than T msecs between executing instructions on the CPU?&lt;br /&gt;
&lt;br /&gt;
Max wait time, T = N(Q+S) - Q ie.last instruction just before context switch executes at the end of the quantum of the first time when process executes..&lt;br /&gt;
T = NQ+NS-Q&lt;br /&gt;
T = Q(N-1)+NS&lt;br /&gt;
Q = (T-NS)/(N-1)&lt;br /&gt;
&lt;br /&gt;
2. Suppose that there are two processes, PH and PL, running in a system. Each process is single-threaded. The operating system’s scheduler is preemptive and uses round-robin scheduling with a quantum of q time units.&lt;br /&gt;
&lt;br /&gt;
The scheduler supports two priority levels, HIGH and LOW. Processes at LOW priority will run only if there are no runnable HIGH priority processes. Process PH is a HIGH priority process.&lt;br /&gt;
It behaves as described in the following pseudo-code:&lt;br /&gt;
&lt;br /&gt;
while (TRUE) do&lt;br /&gt;
compute for tc time units&lt;br /&gt;
block for tb time units to wait for a resource&lt;br /&gt;
end while&lt;br /&gt;
&lt;br /&gt;
That is, if this process were the only one running in the system, it would alternate between running for tc units of time and blocking for tb units of time. Assume that tc is less than q.&lt;br /&gt;
&lt;br /&gt;
Process PL is a low priority process. This process runs forever, doing nothing but computation. That is, it never blocks waiting for a resource.&lt;br /&gt;
&lt;br /&gt;
a. For what percentage of the time will the low priority process PL be running in this system?Express your answer in terms of tb and tc.&lt;br /&gt;
&lt;br /&gt;
tb/(tb + tc)&lt;br /&gt;
&lt;br /&gt;
b. Repeat part (a), but this time under the assumption that there are two HIGH priority processes (PH1 and PH2) and one LOW priority process (PL). Assume that each HIGH priority process waits for a different resource. Again, express your answer in terms of tb and tc. Your answer should be correct for all tb greater than 0 and all 0 less than tc less than q.&lt;br /&gt;
&lt;br /&gt;
(tb−tc)/(tb+tc)   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;   if tc is less than tb&lt;br /&gt;
&lt;br /&gt;
0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                if tc greater than or equal to tb&lt;br /&gt;
------------------------------------------------------------------------------------------------------------&lt;br /&gt;
Suppose a processor uses a prioritized round robin scheduling policy. New processes are assigned an initial quantum of length q. Whenever a process uses its entire quantum without blocking, its new quantum is set to twice its current quantum. If a process blocks before its quantum expires, its new quantum is reset to q. For the purposes of this question, assume that&lt;br /&gt;
every process requires a finite total amount of CPU time.&lt;br /&gt;
(a) Suppose the scheduler gives higher priority to processes that have larger quanta. Is starvation possible in this system? Why or why not?&lt;br /&gt;
No, starvation is not possible. Because we assume that a process will terminate, the worst&lt;br /&gt;
that can happen is that a CPU bound process will continue to execute until it completes.&lt;br /&gt;
When it finishes, one of the lower priority processes will execute. Because the I/O bound&lt;br /&gt;
processes will sit on the low priority queue, they will eventually make it to the head of the&lt;br /&gt;
queue and will not starve.&lt;br /&gt;
(b) Suppose instead that the scheduler gives higher priority to processes that have smaller quanta. Is starvation possible in this system? Why or why not?&lt;br /&gt;
Yes, starvation is possible. Suppose a CPU bound process runs on the processor, uses its&lt;br /&gt;
entire quantum, and has its quantum doubled. Suppose a steady stream of I/O bound processes&lt;br /&gt;
enter the system. Since they will always have a lower quantum and will be selected for&lt;br /&gt;
execution before the process with the doubled quantum, they will starve the original process.&lt;br /&gt;
_______________________________________________________________&lt;br /&gt;
Assume that 3 processes all with requirements of 1 second of CPU time each and&lt;br /&gt;
no I/O arrive at the same time.&lt;br /&gt;
&lt;br /&gt;
a)What will be the average response time (i.e., average time to&lt;br /&gt;
completion) for the processes Round Robin (RR) scheduling assuming a timeslice of 0.1 sec and no overhead for context switches (i.e., context switches are free).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Answer: 2.9 seconds&lt;br /&gt;
&lt;br /&gt;
Explanation:&lt;br /&gt;
&lt;br /&gt;
Time for completion for process A =0.28&lt;br /&gt;
Time for completion for process  B =0.29&lt;br /&gt;
Time for completion for process C = 0.30&lt;br /&gt;
&lt;br /&gt;
Average time for completion =0. 29&lt;br /&gt;
________________________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
Suppose that the operating system is running a round-robin scheduler with a 50 msec time quantum. There are three processes with the following characteristics:&lt;br /&gt;
&lt;br /&gt;
* Process A runs for 60 msec, blocks for 100 msec, runs for 10 msec and terminates.&lt;br /&gt;
* Process B runs for 70 msec, blocks for 40 msec, runs for 20 msec, and terminates.&lt;br /&gt;
* Process C runs for 20 msec, blocks for 80 msec, runs for 60 msec, and terminates.&lt;br /&gt;
&lt;br /&gt;
Process A enters the system at time 0. Process B enters at time 10 msec. Process C enters at time 20 msec. Trace the evolution of the system. You should ignore the time required for a context switch. The time required for process P to block is the actual clock time between the time that P blocks and the time that it unblocks, regardless of anything else that is happening.&lt;br /&gt;
Answer:&lt;br /&gt;
&lt;br /&gt;
Time    Running process     Events&lt;br /&gt;
0-50        A                  B enters at time 10.  C enters at time 20.&lt;br /&gt;
50-100      B&lt;br /&gt;
100-120     C                  C blocks until time 200.&lt;br /&gt;
120-130     A                  A blocks until time 230.&lt;br /&gt;
130-150     B                  B blocks until time 190&lt;br /&gt;
150-190     Idle               B unblocks at time 190&lt;br /&gt;
190-210     B                  C unblocks at time 200. B terminates at time 210&lt;br /&gt;
210-260     C                  A unblocks at time 230.&lt;br /&gt;
260-270     A                  A terminates at time 270.&lt;br /&gt;
270-280     C                  C terminates at time 280.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
_______________________________________________________________________________________________&lt;br /&gt;
Consider a variant of the round-robin scheduling algorithm where the entries in the ready queue are pointers to process-control-blocks.&lt;br /&gt;
&lt;br /&gt;
1. What would be the effect of putting two pointers to the same process in the ready queue?&lt;br /&gt;
&lt;br /&gt;
Doubling the time given to that process.&lt;br /&gt;
2. What would be the major advantages and disadvantages of this scheme?&lt;br /&gt;
&lt;br /&gt;
Simple scheme which would provide some priority work with minimal modification to scheduler. But, overhead for managing pointers is a nuisance -- what if the process is io waiting or done? Have to remove BOTH pointers from ready queue, etc. Also may increase overhead if same process runs back-to-back -- it was not necessary to switch contexts. &lt;br /&gt;
3. How would you modify the basic round-robin algorithm to achieve the same effect without duplicate pointers?&lt;br /&gt;
&lt;br /&gt;
Add a simple quantum indicator to PCB. &lt;br /&gt;
_______________________________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
For each of the following statements, indicate whether you think it is probably true (T) or probably false (F). Then give a brief (one  sentence) reason. There is not necessarily a single correct answer to each question, so your one sentence explanation is the most important part of your answer.&lt;br /&gt;
&lt;br /&gt;
1. Small time slices always improve the average completion time of a system.&lt;br /&gt;
&lt;br /&gt;
Probably false: Small time slices will sometimes improve the average response of the system. If the slice is too small, the context switching time will start to dominate the useful computation time and everything (including response time) will suffer.&lt;br /&gt;
&lt;br /&gt;
2. Using a round robin scheduler, a large time slice is bad for interactive users.&lt;br /&gt;
&lt;br /&gt;
Probably true: Large time slices can allow non-interactive processes keep control of the CPU for longer periods of time, causing the interactive processes to be less responsive.&lt;br /&gt;
&lt;br /&gt;
3. Shortest Job First (SJF) or Shortest Completion Time First (SCTF) scheduling is difficult to build on a real operating system.&lt;br /&gt;
&lt;br /&gt;
Probably true: SCTF scheduling requires knowledge of how much time a process is going to take. This requires future knowledge. You might require a user to specify the maximum amount of time that a process could run (and kill it if it exceeds this amount), then use a variant on SCTF.&lt;br /&gt;
&lt;br /&gt;
________________________________________________________________________________</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/1869632678715240482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/09/round-robin-scheduling-questions.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/1869632678715240482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/1869632678715240482'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/09/round-robin-scheduling-questions.html' title='Round robin scheduling questions'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-2851131121456397261</id><published>2010-09-22T09:52:00.000-07:00</published><updated>2010-09-22T21:19:22.419-07:00</updated><title type='text'>5 Variable Karnaugh Map Solution</title><content type='html'>Simplify the Boolean function &lt;br /&gt;
F(A,B,C,D,E)&amp;nbsp; = Σ (0,2,4,6,9,11,13,15,17,21,25,27,29,31)&lt;br /&gt;
&lt;br /&gt;
Writing decimals in binary,&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Decimal&amp;nbsp;&amp;nbsp; &amp;nbsp;A&amp;nbsp;&amp;nbsp; &amp;nbsp;B&amp;nbsp;&amp;nbsp; &amp;nbsp;C&amp;nbsp;&amp;nbsp; &amp;nbsp;D&amp;nbsp;&amp;nbsp; &amp;nbsp;E&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;0 &amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp;0&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;0&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp;0&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;0&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 13&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 17&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 21&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 25&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp; 0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 29&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;0&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp; 1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&amp;nbsp;&amp;nbsp; &amp;nbsp;1&lt;br /&gt;
&lt;br /&gt;
Construct two Karnaugh maps for variables A,B,C and D when&amp;nbsp; E=0 and E=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAWeH_RoGxMv44qLrmPNCUAI8oXn07ltEfRMtH8a9ZjHsx3WPEwbkQsdcJoADFTz8oN9gpdCnWcOTfaF4eeinpi7eQRIQRpGrGlm_U3efj9sbFMCebU4qQwxhv6wpo1Sq_FXcFoQTLuKPM/s640/KAR_5VAR.bmp&quot; style=&quot;margin-left: auto; margin-right: auto;&quot; width=&quot;640&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAWeH_RoGxMv44qLrmPNCUAI8oXn07ltEfRMtH8a9ZjHsx3WPEwbkQsdcJoADFTz8oN9gpdCnWcOTfaF4eeinpi7eQRIQRpGrGlm_U3efj9sbFMCebU4qQwxhv6wpo1Sq_FXcFoQTLuKPM/s1600/KAR_5VAR.bmp&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
From Karnaugh map E=0,&amp;nbsp; F0 = A&#39;B&#39;E&#39;&lt;br /&gt;
&lt;br /&gt;
From Karnaugh map E=1,&amp;nbsp; F1 =  BE+ AD&#39;E&lt;br /&gt;
&lt;br /&gt;
F&amp;nbsp; = &amp;nbsp; F0+&amp;nbsp; F1 &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;F&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: purple;&quot;&gt;A&#39;B&#39;E&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp; +&amp;nbsp; BE&amp;nbsp; +&amp;nbsp;&amp;nbsp; AD&#39;E&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/2851131121456397261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/09/5-variable-karnaugh-map-solution.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/2851131121456397261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/2851131121456397261'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/09/5-variable-karnaugh-map-solution.html' title='5 Variable Karnaugh Map Solution'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAWeH_RoGxMv44qLrmPNCUAI8oXn07ltEfRMtH8a9ZjHsx3WPEwbkQsdcJoADFTz8oN9gpdCnWcOTfaF4eeinpi7eQRIQRpGrGlm_U3efj9sbFMCebU4qQwxhv6wpo1Sq_FXcFoQTLuKPM/s72-c/KAR_5VAR.bmp" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-2198904402975105545</id><published>2010-09-19T22:45:00.000-07:00</published><updated>2010-10-06T19:49:53.693-07:00</updated><title type='text'>Computer Architecture -  Counters</title><content type='html'>&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://maxwell.me.gu.edu.au/yg/teaching/dns/dns_module3_p1.pdf#page=5&quot;&gt;Overview&lt;/a&gt; -&amp;nbsp; Types of counters&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.play-hookey.com/digital/synchronous_counter.html&quot;&gt;Synchronous Counter Design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.eelab.usyd.edu.au/digital_tutorial/part3/example1-5.htm&quot;&gt;3 bit counter using J-K flipflops&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/2198904402975105545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/09/computer-architecture-counters.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/2198904402975105545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/2198904402975105545'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/09/computer-architecture-counters.html' title='Computer Architecture -  Counters'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-6204232726460548075</id><published>2010-09-08T16:43:00.000-07:00</published><updated>2010-10-29T23:02:28.489-07:00</updated><title type='text'>Recurrence relations examples</title><content type='html'>&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5CMCHEEN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5CMCHEEN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5CMCHEEN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:宋体;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
	{font-family:&quot;\@SimSun&quot;;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	text-indent:11.5pt;
	mso-pagination:widow-orphan;
	font-size:14.0pt;
	font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;
	mso-fareast-font-family:SimSun;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-size:10.0pt;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	mso-fareast-font-family:SimSun;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 0in;&quot;&gt;&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Generator&quot;&gt;&lt;/meta&gt;&lt;meta content=&quot;Microsoft Word 12&quot; name=&quot;Originator&quot;&gt;&lt;/meta&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5CMCHEEN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml&quot; rel=&quot;File-List&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5CMCHEEN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx&quot; rel=&quot;themeData&quot;&gt;&lt;/link&gt;&lt;link href=&quot;file:///C:%5CDOCUME%7E1%5CMCHEEN%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml&quot; rel=&quot;colorSchemeMapping&quot;&gt;&lt;/link&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:宋体;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
	{font-family:&quot;Cambria Math&quot;;
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
	{font-family:&quot;\@SimSun&quot;;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:&quot;&quot;;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	text-indent:11.5pt;
	mso-pagination:widow-orphan;
	font-size:14.0pt;
	font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;
	mso-fareast-font-family:SimSun;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-size:10.0pt;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	mso-fareast-font-family:SimSun;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.WordSection1
	{page:WordSection1;}
--&gt;
&lt;/style&gt;  &lt;/div&gt;Solve the recurrence relation T(n) = T(n/2) + lg(n) where T(1) = 1 and n = 2k for a nonnegative integer k. Your answer should be a precise function of n in closed form. Note that lg represents the log function base 2.&lt;br /&gt;
&lt;br /&gt;
T(n) = T(n/2) + lg(n)&lt;br /&gt;
&lt;br /&gt;
T(n/2) = T(n/4) + lg(n/2)&lt;br /&gt;
&lt;br /&gt;
T(n/4) = T(n/8) + lg(n/4)&lt;br /&gt;
&lt;br /&gt;
T(n/8) = T(n/16) + lg(n/8)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substituting for T(n)&lt;br /&gt;
&lt;br /&gt;
T(n)  =   T(n/2) + lg(n)&lt;br /&gt;
&lt;br /&gt;
=    T(n/4) + lg(n/2)+lg(n)&lt;br /&gt;
&lt;br /&gt;
=    T(n/8)+ lg(n/4)+ lg(n/2)+lg(n)&lt;br /&gt;
&lt;br /&gt;
=   T(n/16)+lg(n/8)+ lg(n/4)+ lg(n/2)+lg(n)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Suppose n= 2**k&lt;br /&gt;
&lt;br /&gt;
T(n)  =  1  +   lg (n.  n/2 .  n/4. . . . .  n/2**k-1)           &lt;br /&gt;
&lt;br /&gt;
= 1+  lg(2**k&amp;nbsp; .   2**k-1 . &amp;nbsp;  2**k-2 .&amp;nbsp; …… . 2)&lt;br /&gt;
&lt;br /&gt;
= 1+  lg( 2 **(1+2+3+ - - - +k))&lt;br /&gt;
&lt;br /&gt;
= 1 + (1+2+3+  ----+k)&lt;br /&gt;
&lt;br /&gt;
= 1+  k(k+1)/2&lt;br /&gt;
&lt;br /&gt;
______________________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
Solve the recurrence T(n) = T(n-1) + n&lt;br /&gt;
&lt;br /&gt;
T(n)&amp;nbsp;&amp;nbsp;&amp;nbsp; = T(n-1) + n&lt;br /&gt;
T(n-1) = T(n-2) + n-1&lt;br /&gt;
T(n-2) = T(n-3) + n-2&lt;br /&gt;
T(n-3) = T(n-4) + n -3&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;T(n)&amp;nbsp; =&amp;nbsp; T(n-1) + n&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; = &amp;nbsp;  T(n-2) + n-1+n&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp; T(n-3) + n-2+n-1+n&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp; T(n-4) + n-3+n-2+n-1+n&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Consider n= 2**k&lt;br /&gt;
&amp;nbsp;T(n)&amp;nbsp; =&amp;nbsp; T(n-k) + n+n-1+n-2+n-3+ -------------+n-(k-1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;  T(n-k) +&amp;nbsp; n(n-1) - k(k-1)/2&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = T(n-k) +&amp;nbsp; n**2 - n -lgn(lgn-1)/2&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
Therefore, asymptotic complexity is n**2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/6204232726460548075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/09/recurrence-relations-examples.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/6204232726460548075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/6204232726460548075'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/09/recurrence-relations-examples.html' title='Recurrence relations examples'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-8452873451379106290</id><published>2010-08-31T12:06:00.000-07:00</published><updated>2010-08-31T12:06:27.004-07:00</updated><title type='text'>Delete a linked list using recursion in C++</title><content type='html'>#include &amp;lt; iostream &amp;gt;&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
struct Node{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int num;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Node* next;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
//Here address of pointer to the list is passed so that head of the&amp;nbsp; list&amp;nbsp; will not be a local variable. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;void DeleteListRecursion(Node*&amp;amp; list){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(list == NULL)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;DeleteListRecursion(list-&amp;gt;next);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;delete(list);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;list = NULL;&lt;br /&gt;
}&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Node* Insert(int number, Node* list){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Node* node = new Node;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; node-&amp;gt;num = number;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; node-&amp;gt;next = list;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return node;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;//TEST&lt;/div&gt;&lt;br /&gt;
int main(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Node* list = NULL;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = Insert(5,list);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = Insert(7,list);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = Insert(9,list);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = Insert(4,list);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = Insert(6,list);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; list = Insert(3,list);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; DeleteListRecursion(list);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/8452873451379106290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/08/delete-linked-list-using-recursion-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/8452873451379106290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/8452873451379106290'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/08/delete-linked-list-using-recursion-in-c.html' title='Delete a linked list using recursion in C++'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-295168065545267996.post-3223768005747325968</id><published>2010-08-28T10:38:00.000-07:00</published><updated>2010-11-04T10:59:38.057-07:00</updated><title type='text'>Data Structures You Should Know</title><content type='html'>&lt;ul&gt;&lt;li&gt;Big Oh of common algorithms : &lt;a href=&quot;http://www.mcs.csueastbay.edu/%7Ebillard/cs3240/big-oh.html&quot;&gt;http://www.mcs.csueastbay.edu/~billard/cs3240/big-oh.html &lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;Binary Search &lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;UnSorted List Using Arrays&lt;/li&gt;
&lt;li&gt;UnSorted List Using Linked List&lt;/li&gt;
&lt;li&gt;Sorted List Using Arrays&lt;/li&gt;
&lt;li&gt;Sorted List Using Linked List&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Doubly Linked List&lt;/li&gt;
&lt;li&gt;Circular List&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Stack Using Arrays&lt;/li&gt;
&lt;li&gt;Stack Using LinkedList&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Queue Using arrays&lt;/li&gt;
&lt;li&gt;Queue Using LinkedList&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Recursion Problems&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Binary Tree&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Graph&amp;nbsp;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Minimum Spanning Tree &lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Kruskals Algorithm&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.ics.uci.edu/%7Eeppstein/161/960206.html&quot;&gt;Pseudocode&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.personal.kent.edu/%7Ermuhamma/Algorithms/MyAlgorithms/GraphAlgor/kruskalAlgor.htm&quot;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Prim&#39;s Algorithm &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://www.ics.uci.edu/%7Eeppstein/161/960206.html&quot;&gt;Pseudocode&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://students.ceid.upatras.gr/%7Epapagel/project/prim.htm&quot;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Sorting&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Bubble Sort&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Example&lt;/li&gt;
&lt;li&gt;Selection Sort&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://www.fredosaurus.com/notes-cpp/algorithms/sorting/selectionsort.html&quot;&gt;Code&lt;/a&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Example&lt;/li&gt;
&lt;li&gt;Insertion Sort&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Example&lt;/li&gt;
&lt;li&gt;QuickSort&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Example&lt;/li&gt;
&lt;li&gt;MergeSort&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Example&lt;/li&gt;
&lt;li&gt;&lt;b&gt;HeapSort&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href=&quot;http://faculty.simpson.edu/lydia.sinapova/www/cmsc250/LN250_Weiss/L13-HeapSortEx.htm&quot;&gt;Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Radix Sort&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Example &lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Hashing&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://compquiz.blogspot.com/feeds/3223768005747325968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://compquiz.blogspot.com/2010/08/data-structures-you-should-know.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/3223768005747325968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/295168065545267996/posts/default/3223768005747325968'/><link rel='alternate' type='text/html' href='http://compquiz.blogspot.com/2010/08/data-structures-you-should-know.html' title='Data Structures You Should Know'/><author><name>quiz team</name><uri>http://www.blogger.com/profile/16082994848540617737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>