<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>GeeksforGeeks &#187; Recent Posts</title>
		<link>http://geeksforgeeks.org/forum/</link>
		<description>Coming together of Geeks</description>
		<language>en-US</language>
		<pubDate>Fri, 18 May 2012 21:56:29 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://geeksforgeeks.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://geeksforgeeks.org/forum/rss/" rel="self" type="application/rss+xml" />

		<item>
			<title>Kumar on "Google interview question"</title>
			<link>http://geeksforgeeks.org/forum/topic/google-interview-question-9#post-37306</link>
			<pubDate>Fri, 18 May 2012 19:45:23 +0000</pubDate>
			<dc:creator>Kumar</dc:creator>
			<guid isPermaLink="false">37306@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;Given two  BST print the element in sorted form &#60;/p&#62;
&#60;p&#62;complexity O(n) time   maxm alloted space will be  O(height of bigger tree)&#60;/p&#62;
&#60;p&#62;eg ;&#60;/p&#62;
&#60;pre&#62;
T1
     3
1       5

T2

    4
2       6
&#60;/pre&#62;
&#60;p&#62;o/p    1  2 3 4 5 6
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sresta on "puzzle"</title>
			<link>http://geeksforgeeks.org/forum/topic/puzzle-7#post-37305</link>
			<pubDate>Fri, 18 May 2012 16:49:52 +0000</pubDate>
			<dc:creator>sresta</dc:creator>
			<guid isPermaLink="false">37305@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;write a program in which printf print -1 ......when printf executes sucessfully den it returns positive value.....same as.. if printf doesn't execute successfullyden it prints -1 ..when?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Venki on "Longest Increasing Subsequence O(nlogn)"</title>
			<link>http://geeksforgeeks.org/forum/topic/longest-increasing-subsequence-onlogn#post-37304</link>
			<pubDate>Fri, 18 May 2012 11:42:23 +0000</pubDate>
			<dc:creator>Venki</dc:creator>
			<guid isPermaLink="false">37304@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;&#60;a href=&#34;http://www.geeksforgeeks.org/archives/9591&#34; rel=&#34;nofollow&#34;&#62;http://www.geeksforgeeks.org/archives/9591&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Venki on "Finding the Longest Increasing Sub-sequence in an Array"</title>
			<link>http://geeksforgeeks.org/forum/topic/finding-the-longest-increasing-sub-sequence-in-an-array#post-37303</link>
			<pubDate>Fri, 18 May 2012 11:42:03 +0000</pubDate>
			<dc:creator>Venki</dc:creator>
			<guid isPermaLink="false">37303@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;&#60;a href=&#34;http://www.geeksforgeeks.org/archives/9591&#34; rel=&#34;nofollow&#34;&#62;http://www.geeksforgeeks.org/archives/9591&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Venki on "Microsoft Interview Question for Software Engineer/Developer about Algorithms, Arrays"</title>
			<link>http://geeksforgeeks.org/forum/topic/microsoft-interview-question-for-software-engineerdeveloper-about-algorithms-arrays-4#post-37302</link>
			<pubDate>Fri, 18 May 2012 11:41:29 +0000</pubDate>
			<dc:creator>Venki</dc:creator>
			<guid isPermaLink="false">37302@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;Published,&#60;br /&#62;
&#60;a href=&#34;http://www.geeksforgeeks.org/archives/9591&#34; rel=&#34;nofollow&#34;&#62;http://www.geeksforgeeks.org/archives/9591&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Guddu Sharma on "Getting kth smallest element"</title>
			<link>http://geeksforgeeks.org/forum/topic/getting-kth-smallest-element#post-37301</link>
			<pubDate>Fri, 18 May 2012 05:11:30 +0000</pubDate>
			<dc:creator>Guddu Sharma</dc:creator>
			<guid isPermaLink="false">37301@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;Find the kth smallest element in an unsorted array.&#60;br /&#62;
My approach is the modified partitioning algorithm done during quick sort.&#60;br /&#62;
Here is the code which is working correctly. Please help me out getting the time complexity of the code..&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;int partition(int *arr,int low,int high)
{
	int pivot,i,j;
	i=low;
	j=high+1;
	pivot=arr[low];

	while(1)
	{
		do
			i++;
		while(i&#38;lt;=high &#38;amp;&#38;amp; pivot&#38;gt;arr[i]);

		do
			j--;
		while(j&#38;gt;low &#38;amp;&#38;amp; pivot&#38;lt;arr[j]);

		if(i&#38;lt;j)
			arr[i]=(arr[i]+arr[j])-(arr[j]=arr[i]);
		else
		{
			arr[low]=(arr[low]+arr[j])-(arr[j]=arr[low]);

			return j;
		}
	}
}

int findKthSmallestElement(int *arr,int low,int high,int k)
{
	static int mid;
	if(low==high &#38;amp;&#38;amp; k==low)
		return arr[low];
	if(low&#38;lt;high)
	{
		mid=partition(arr,low,high);
		if(k==mid)
			return arr[mid];
		else if(k&#38;lt;mid)
			findKthSmallestElement(arr,low,mid-1,k);
		else
			findKthSmallestElement(arr,mid+1,high,k);
	}
}

int main()
{
	int n,arr[20],i,k;

	printf(&#38;quot;Enter number of elements: &#38;quot;);
	scanf(&#38;quot;%d&#38;quot;,&#38;amp;n);

	printf(&#38;quot;Enter the elements:\n&#38;quot;);
	for(i=0;i&#38;lt;n;i++)
		scanf(&#38;quot;%d&#38;quot;,&#38;amp;arr[i]);

	printf(&#38;quot;Enter the value of k: &#38;quot;);
	scanf(&#38;quot;%d&#38;quot;,&#38;amp;k);

	if(k&#38;lt;=n)
		printf(&#38;quot;\n\nKth smallest element is: %d\n\n&#38;quot;,findKthSmallestElement(arr,0,n-1,k-1));
	else
		printf(&#38;quot;Out of range\n\n&#38;quot;);

	return 0;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>spandan on "interview question"</title>
			<link>http://geeksforgeeks.org/forum/topic/interview-question-33#post-37300</link>
			<pubDate>Fri, 18 May 2012 00:35:20 +0000</pubDate>
			<dc:creator>spandan</dc:creator>
			<guid isPermaLink="false">37300@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;@romi,yes offcourse...in case there are multiple entries,we have to go with Linear search..!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>spandan on "Add two Numbers"</title>
			<link>http://geeksforgeeks.org/forum/topic/add-two-numbers#post-37299</link>
			<pubDate>Thu, 17 May 2012 01:30:15 +0000</pubDate>
			<dc:creator>spandan</dc:creator>
			<guid isPermaLink="false">37299@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;pre&#62;
struct num
{
	int data;
	struct num *next;
};

struct num* addnum(num *a,num *b);

main()
{
	num *a,*b,*c;

	a=new num;
	b=new num;
	a-&#38;gt;data=2;
	a-&#38;gt;next=new num;
	a-&#38;gt;next-&#38;gt;data=4;
	a-&#38;gt;next-&#38;gt;next=new num;
	a-&#38;gt;next-&#38;gt;next-&#38;gt;data=3;
	a-&#38;gt;next-&#38;gt;next-&#38;gt;next=NULL;
	b-&#38;gt;data=5;
	b-&#38;gt;next=new num;
	b-&#38;gt;next-&#38;gt;data=6;
	b-&#38;gt;next-&#38;gt;next=new num;
	b-&#38;gt;next-&#38;gt;next-&#38;gt;data=4;
	b-&#38;gt;next-&#38;gt;next-&#38;gt;next=NULL;
	c=addnum(a,b);

	while(c!=NULL)
	{
		cout&#38;lt;&#38;lt;c-&#38;gt;data;
		c=c-&#38;gt;next;
	}

}

struct num* addnum(num*a,num*b)
{
	struct num *c=NULL;

	int x=0,y=0,n=1,sum;
	num *q=a;

	while(q!=NULL)
	{
		x+=n*q-&#38;gt;data;
		q=q-&#38;gt;next;
		n=n*10;
	}

	n=1;
	q=b;
	while(q!=NULL)
	{
		y+=n*q-&#38;gt;data;
		q=q-&#38;gt;next;
		n=n*10;
	}

	sum=x+y;

	q=NULL;
	num*temp;
	while(sum&#38;gt;=1)
	{
		q=new num;
		q-&#38;gt;data=sum%10;
		q-&#38;gt;next=NULL;
		if(c==NULL)
		{
			c=q;
			temp=c;
		}
		else
		{
			temp-&#38;gt;next=q;
			temp=q;
		}
		sum=sum/10;
	}

	return c;
}
&#60;/pre&#62;</description>
		</item>
		<item>
			<title>asm on "Facebook Interview Question"</title>
			<link>http://geeksforgeeks.org/forum/topic/facebook-interview-question#post-37298</link>
			<pubDate>Wed, 16 May 2012 21:24:31 +0000</pubDate>
			<dc:creator>asm</dc:creator>
			<guid isPermaLink="false">37298@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;{1,5,18,25} indeed seems to be an optimal solution but the average would be 3.93&#60;br /&#62;
I get the result using brute force..  Can anyone think of optimized solution ??&#60;/p&#62;
&#60;pre&#62;
float get_avg_sum(std::vector&#38;lt; int &#38;gt;&#38;amp; coins, int S) {
    std::vector&#38;lt; int &#38;gt; Q(S + 1, 100000); // min no of coins to get this sum
    Q[0] = 0;
    int i, s;
    for(i = 0; i &#38;lt; coins.size(); i++)
    for(s = 1; s &#38;lt;= S; s++) {
        if(s &#38;gt;= coins[i])
            Q[s] = std::min(Q[s], Q[s - coins[i]] + 1);
    }
    int avg = 0;
    for(s = 0; s &#38;lt;= S; s++) {
        avg += Q[s];
    }
    return ((float)avg/S);
}

std::vector&#38;lt; int &#38;gt; coins_set;
float min_avg = 1e10;
std::vector&#38;lt; int &#38;gt; opt_set;

void brute_force(int n_used, int coin_sum, int N, int S) {
    float avg = get_avg_sum(coins_set, S);
    if(min_avg &#38;gt; avg) {
        min_avg = avg;
        opt_set = coins_set;
    }

    if(n_used &#38;lt; N) {
        int next = coins_set[n_used - 1] + 1;
        for(; next &#38;lt;= S - coin_sum; next++) {
            coins_set.push_back(next);
            brute_force(n_used+1, coin_sum + next, N, S);
            coins_set.pop_back();
        }
    }
}

int main() {
    coins_set.push_back(1); // first coin is always 1
    int N = 4;
    brute_force(1, 1, N, 100);

    printf(&#34;avg: %.3f; coins: [&#34;, min_avg);
    for(int j = 0; j &#38;lt; opt_set.size(); j++) {
        printf(&#34; %d&#34;, opt_set[j]);
    }
    printf(&#34;]\n&#34;);
    return 1;
}
&#60;/pre&#62;</description>
		</item>
		<item>
			<title>kirthu on "Amazon Interview Question for Software Engineer/Developer (More than 5 Years) about Linked Lists"</title>
			<link>http://geeksforgeeks.org/forum/topic/amazon-interview-question-for-software-engineerdeveloper-more-than-5-years-about-linked-lists#post-37297</link>
			<pubDate>Wed, 16 May 2012 21:06:58 +0000</pubDate>
			<dc:creator>kirthu</dc:creator>
			<guid isPermaLink="false">37297@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;isn't this same as sorting a LL???
&#60;/p&#62;</description>
		</item>
		<item>
			<title>atul007 on "Amazon Interview Question Password Checker"</title>
			<link>http://geeksforgeeks.org/forum/topic/amazon-interview-question-password-checker#post-37296</link>
			<pubDate>Wed, 16 May 2012 15:42:17 +0000</pubDate>
			<dc:creator>atul007</dc:creator>
			<guid isPermaLink="false">37296@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;as question does not mention if the given input  &#34;aaaa&#34; is a correct or incorrect , but i am considering it incorrect.&#60;/p&#62;
&#60;p&#62;so below program will work if input have 2 or more contiguous similar character.&#60;/p&#62;
&#60;p&#62;it is similar to @spandan idea ,  but much cleaner.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;int checkPassword(char *pass,int  len)
{

int mask[200];
int index[200],i,k,new_s,prev_s,flag=0;

for(i=0;i&#38;lt;199;i++)
{
	mask[i]=0;
	index[i]=0;
}

for(i=0;i&#38;lt;len;i++)
{
	if(mask[pass[i]]==0)
	{
		mask[pass[i]]=1; // masking character found in password
		index[pass[i]]=i; // saving its index
	}
	else
	{
		if(i &#38;gt; 0)
		{
			new_s=i; // new index found which was already masked
			prev_s=index[pass[i]];  // previous index of that masked charcter

			if(new_s!=prev_s)  // checking if we are not at same indexes
			{
                               // checking if character matches in staring from prev_index and new_index
				while(pass[prev_s]==pass[new_s] &#38;amp;&#38;amp; prev_s &#38;lt; i )
				{
					//updating character index[] with new index value for future check
					index[pass[prev_s]]=new_s;
					prev_s++;
					new_s++;
				}
				if(prev_s == i) // all charcter matched then wrong passowrd
				{
					printf(&#38;quot;\n\n%s is aWrong Password\n&#38;quot;,pass);
					flag=1;
					break;
				}
			}
		}

	}

}
if(flag == 0)
{
	printf(&#38;quot;\n\n%s is a Correct password\n\n&#38;quot;,pass);
}

}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;time complexity = O(n)&#60;br /&#62;
if you check the code carefully we are doing 2n iteration at max.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>asm on "find all increasing subsequences"</title>
			<link>http://geeksforgeeks.org/forum/topic/find-all-increasing-subsequences#post-37295</link>
			<pubDate>Wed, 16 May 2012 14:58:25 +0000</pubDate>
			<dc:creator>asm</dc:creator>
			<guid isPermaLink="false">37295@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;good idea @Venki,&#60;br /&#62;
yet it seems that this DAG can have O(n^2) edges. Then, provided that we need to find&#60;br /&#62;
a longest path for every vertex, looks like we cannot do this in O(n^2) time ?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Venki on "find all increasing subsequences"</title>
			<link>http://geeksforgeeks.org/forum/topic/find-all-increasing-subsequences#post-37294</link>
			<pubDate>Wed, 16 May 2012 12:43:49 +0000</pubDate>
			<dc:creator>Venki</dc:creator>
			<guid isPermaLink="false">37294@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;We can also model the problem using graphs.&#60;/p&#62;
&#60;p&#62;Since we need all the increasing subsequences, we can represent the array as DAG in which smaller elements point to larger elements. To trace all the increasing subsequences, for every vertex (i.e. array element) find the end vertex and print the path.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Romi on "Add two Numbers"</title>
			<link>http://geeksforgeeks.org/forum/topic/add-two-numbers#post-37293</link>
			<pubDate>Wed, 16 May 2012 11:39:59 +0000</pubDate>
			<dc:creator>Romi</dc:creator>
			<guid isPermaLink="false">37293@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;visit solution on &#60;a href=&#34;http://programming-debugging.blogspot.in/2012/05/add-two-number.html&#34; rel=&#34;nofollow&#34;&#62;http://programming-debugging.blogspot.in/2012/05/add-two-number.html&#60;/a&#62;&#60;br /&#62;
and suggest modification and better solution if you have got.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Romi on "Add two Numbers"</title>
			<link>http://geeksforgeeks.org/forum/topic/add-two-numbers#post-37292</link>
			<pubDate>Wed, 16 May 2012 11:38:55 +0000</pubDate>
			<dc:creator>Romi</dc:creator>
			<guid isPermaLink="false">37292@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.&#60;/p&#62;
&#60;p&#62;Input: (2 -&#38;gt; 4 -&#38;gt; 3) + (5 -&#38;gt; 6 -&#38;gt; 4)&#60;br /&#62;
Output: 7 -&#38;gt; 0 -&#38;gt; 8
&#60;/p&#62;</description>
		</item>
		<item>
			<title>spandan on "Amazon Interview Question Password Checker"</title>
			<link>http://geeksforgeeks.org/forum/topic/amazon-interview-question-password-checker#post-37291</link>
			<pubDate>Wed, 16 May 2012 00:49:42 +0000</pubDate>
			<dc:creator>spandan</dc:creator>
			<guid isPermaLink="false">37291@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;using 2 count arrays,&#60;br /&#62;
one for keeping check of charcters,other for string their index...&#60;br /&#62;
main()&#60;br /&#62;
{&#60;br /&#62;
	int a[256];//for sting the encounterd charcter&#60;br /&#62;
	int b[256];// for storing its index&#60;br /&#62;
	char c[50];&#60;br /&#62;
	cin&#38;gt;&#38;gt;c;&#60;br /&#62;
	int i,j,flag=0;&#60;br /&#62;
	for(int k=0;c[k]!='';k++)&#60;br /&#62;
	{&#60;br /&#62;
		if(a[c[k]]!=1)&#60;br /&#62;
		{&#60;br /&#62;
			a[c[k]]=1;&#60;br /&#62;
			b[c[k]]=k;&#60;br /&#62;
		}&#60;br /&#62;
		else&#60;br /&#62;
		{&#60;br /&#62;
			i=b[c[k]];&#60;br /&#62;
			j=k;&#60;br /&#62;
			while(c[j]!='' &#38;amp;&#38;amp; c[i]==c[j])&#60;br /&#62;
			{&#60;br /&#62;
				i++,j++;&#60;br /&#62;
			}&#60;br /&#62;
			if(i==k)&#60;br /&#62;
			{&#60;br /&#62;
				flag=1;&#60;br /&#62;
				break;&#60;br /&#62;
			}&#60;br /&#62;
			else&#60;br /&#62;
				b[c[k]]=k;&#60;br /&#62;
		}&#60;br /&#62;
	}&#60;br /&#62;
		if(flag==1)&#60;br /&#62;
			cout&#38;lt;&#38;lt;&#34;incorrect&#34;;&#60;br /&#62;
		else&#60;br /&#62;
			cout&#38;lt;&#38;lt;&#34;corrrect&#34;;&#60;/p&#62;
&#60;p&#62;}
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Venki on "Find majority Element using Divide and Conquer Algorithm"</title>
			<link>http://geeksforgeeks.org/forum/topic/find-majority-element-using-divide-and-conquer-algorithm#post-37290</link>
			<pubDate>Tue, 15 May 2012 22:50:14 +0000</pubDate>
			<dc:creator>Venki</dc:creator>
			<guid isPermaLink="false">37290@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;Good exercise for practicing recursive algorithms, here is the code, &#60;/p&#62;
&#60;p&#62;Initial call: Majority(A, 0, size-1)&#60;br /&#62;
Complexity: N log N&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
int Majority(int A[], int l, int r)&#60;br /&#62;
{&#60;br /&#62;
    int size = r - l + 1;&#60;/p&#62;
&#60;p&#62;    if( size == 1 )&#60;br /&#62;
        return A[l];&#60;/p&#62;
&#60;p&#62;    if( size == 2 )&#60;br /&#62;
        return A[l] == A[r] ? A[l] : -1;&#60;/p&#62;
&#60;p&#62;    int leftMajority, leftCount = 0;&#60;br /&#62;
    int rightMajority, rightCount = 0;&#60;/p&#62;
&#60;p&#62;    int m = l + size/2;&#60;/p&#62;
&#60;p&#62;    leftMajority = Majority(A, l, m);&#60;br /&#62;
    rightMajority = Majority(A, m+1, r);&#60;/p&#62;
&#60;p&#62;    if( leftMajority != -1 )&#60;br /&#62;
        for( int  i = l; i &#38;lt;= r; i++ )&#60;br /&#62;
            if( leftMajority == A[i] )&#60;br /&#62;
                leftCount++;&#60;/p&#62;
&#60;p&#62;    if( rightMajority != -1 )&#60;br /&#62;
        for( int  i = l; i &#38;lt;= r; i++ )&#60;br /&#62;
            if( rightMajority == A[i] )&#60;br /&#62;
                rightCount++;&#60;/p&#62;
&#60;p&#62;    if( leftCount &#38;gt; rightCount )&#60;br /&#62;
        return leftCount &#38;gt; (m - l + 1)/2 ? leftMajority : -1;&#60;/p&#62;
&#60;p&#62;    if( leftCount &#38;lt; rightCount )&#60;br /&#62;
        return rightSize &#38;gt; (r - m)/2 ? rightMajority : -1;&#60;/p&#62;
&#60;p&#62;    return -1;&#60;br /&#62;
}&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>GeeksforGeeks on "Maximum Sum Increasing Subsequence Problem"</title>
			<link>http://geeksforgeeks.org/forum/topic/algorithm-1#post-37289</link>
			<pubDate>Tue, 15 May 2012 22:21:19 +0000</pubDate>
			<dc:creator>GeeksforGeeks</dc:creator>
			<guid isPermaLink="false">37289@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;This has been published.  Please see &#60;a href=&#34;http://www.geeksforgeeks.org/archives/19248&#34; rel=&#34;nofollow&#34;&#62;http://www.geeksforgeeks.org/archives/19248&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>varadharajan on "Binary Tree to BST"</title>
			<link>http://geeksforgeeks.org/forum/topic/binary-tree-to-bst#post-37288</link>
			<pubDate>Tue, 15 May 2012 15:57:32 +0000</pubDate>
			<dc:creator>varadharajan</dc:creator>
			<guid isPermaLink="false">37288@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;@manishj Thanks for posting...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>akshayjohri on "FB interview question"</title>
			<link>http://geeksforgeeks.org/forum/topic/fb-interview-question#post-37287</link>
			<pubDate>Mon, 14 May 2012 16:52:21 +0000</pubDate>
			<dc:creator>akshayjohri</dc:creator>
			<guid isPermaLink="false">37287@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;Say, we require probability 65/100.&#60;br /&#62;
we call the function 100 times, so for 65 times we need 1 as output.&#60;/p&#62;
&#60;p&#62;What if we generate random number between 1 and 100 both included and return 1 if the number is less than equal to 65.&#60;/p&#62;
&#60;p&#62;So our probability of success if 65(winning cases)/100(total cases)&#60;/p&#62;
&#60;p&#62;bool Zoo(int x){&#60;br /&#62;
int num=rand()%y+1;&#60;br /&#62;
if(num&#38;lt;=x) return 1;&#60;br /&#62;
else return 0;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;A random number generator will be sufficient (We can probably have a generator that doesnt repeat numbers)&#60;/p&#62;
&#60;p&#62;Comments?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>akshayjohri on "Testing of factorial of a number"</title>
			<link>http://geeksforgeeks.org/forum/topic/testing-of-factorial-of-a-number#post-37286</link>
			<pubDate>Mon, 14 May 2012 16:45:31 +0000</pubDate>
			<dc:creator>akshayjohri</dc:creator>
			<guid isPermaLink="false">37286@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;Factorial of 12 overflows out of &#34;int&#34; variable
&#60;/p&#62;</description>
		</item>
		<item>
			<title>geek4u on "MS interview question"</title>
			<link>http://geeksforgeeks.org/forum/topic/ms-interview-question-2#post-37285</link>
			<pubDate>Mon, 14 May 2012 16:38:12 +0000</pubDate>
			<dc:creator>geek4u</dc:creator>
			<guid isPermaLink="false">37285@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;A simple Trie question. &#60;/p&#62;
&#60;p&#62;Build a Trie of dictionary words. This step will take O(n) where n is the number of characters in words.&#60;/p&#62;
&#60;p&#62;Process every given word through Trie. This will take O(m) time where m is the total number of characters in the list of words.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>atul007 on "Amazon Interview Question Password Checker"</title>
			<link>http://geeksforgeeks.org/forum/topic/amazon-interview-question-password-checker#post-37284</link>
			<pubDate>Mon, 14 May 2012 15:34:22 +0000</pubDate>
			<dc:creator>atul007</dc:creator>
			<guid isPermaLink="false">37284@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;@kartik : could you please elaborate algo using suffice tree
&#60;/p&#62;</description>
		</item>
		<item>
			<title>VIPUL on "Facebook Interview Question"</title>
			<link>http://geeksforgeeks.org/forum/topic/facebook-interview-question#post-37283</link>
			<pubDate>Mon, 14 May 2012 09:50:11 +0000</pubDate>
			<dc:creator>VIPUL</dc:creator>
			<guid isPermaLink="false">37283@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;You are given an integer N and an integer M. You are supposed to write a method void findBestCoinsThatMinimizeAverage(int N, int M) that prints the best collection of N coins that minimize the average number of minimum coins needed to generate values from 1 to M. So, if M = 100, and N = 4, then if we use the set {1, 5, 10, 25} to generate each value from 1 to 100, so that for each value the number of coins are minimized, i.e. 1 = 1 (1 coin), 2 = 1 + 1 (2 coins),..., 6 = 1 + 5 (2 coins), ..., 24 = 5 + 5 + 5 + 5 + 1 + 1 + 1 + 1 (8 coins), and we take the average of these coins, we would see that the average comes out to ~5.7. But if we instead use {1, 5, 18, 25}, the average would come out to be 3.7. We are to find that set of N coins, and print them, that produce the minimum average.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>freakCoder on "MS interview question"</title>
			<link>http://geeksforgeeks.org/forum/topic/ms-interview-question-2#post-37282</link>
			<pubDate>Mon, 14 May 2012 08:05:00 +0000</pubDate>
			<dc:creator>freakCoder</dc:creator>
			<guid isPermaLink="false">37282@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;Given a list of words and a dictionary with many words. The dictionary may or may not include the the given list of words. From the given list of words,you need to print only those words which are present in dictionary.&#60;br /&#62;
Mention time complexity.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>freakCoder on "MS interview question"</title>
			<link>http://geeksforgeeks.org/forum/topic/ms-interview-question-1#post-37281</link>
			<pubDate>Mon, 14 May 2012 08:01:58 +0000</pubDate>
			<dc:creator>freakCoder</dc:creator>
			<guid isPermaLink="false">37281@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;Given a set of numbers from 1 to n^2,  generate subsets consisting of n numbers such that each subset has one and only one matching number from any other subset&#60;/p&#62;
&#60;p&#62;The max number of sub-sets is n squared + n&#60;/p&#62;
&#60;p&#62;An example is as follows:&#60;br /&#62;
n = 3&#60;br /&#62;
n squared set = 1, 2, 3, 4, 5, 6, 7, 8, 9&#60;/p&#62;
&#60;p&#62;sub-set 1 = 1, 2, 3&#60;br /&#62;
sub-set 2 = 1, 4, 7&#60;br /&#62;
sub-set 3 = 1, 5, 9&#60;br /&#62;
sub-set 4 = 1, 6, 8&#60;br /&#62;
sub-set 5 = 2, 5, 8&#60;br /&#62;
sub-set 6 = 2, 4, 9&#60;br /&#62;
sub-set 7 = 2, 6, 7&#60;br /&#62;
sub-set 8 = 3, 6, 9&#60;br /&#62;
sub-set 9 = 3, 5, 7&#60;br /&#62;
sub-set 10 = 3. 4, 8&#60;br /&#62;
sub-set 11 = 4, 5, 6&#60;br /&#62;
sub-set 12 = 7, 8, 9
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vijayiz on "Java"</title>
			<link>http://geeksforgeeks.org/forum/topic/java-1#post-37280</link>
			<pubDate>Mon, 14 May 2012 01:28:52 +0000</pubDate>
			<dc:creator>vijayiz</dc:creator>
			<guid isPermaLink="false">37280@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;What is @override annotation in java? what it will do?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Venki on "find all increasing subsequences"</title>
			<link>http://geeksforgeeks.org/forum/topic/find-all-increasing-subsequences#post-37279</link>
			<pubDate>Mon, 14 May 2012 01:05:04 +0000</pubDate>
			<dc:creator>Venki</dc:creator>
			<guid isPermaLink="false">37279@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;The LIS problem can be solved in N log N time. DP takes N^2 time due to table construction. In case of N log N approach, we keep track of all the increasing subsequences, and the current element can extend any one of them or may start altogether new sequence. If the element extends existing sequence we do binary search for its position.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>asm on "Amazon Banglore Online Written"</title>
			<link>http://geeksforgeeks.org/forum/topic/amazon-banglore-online-written-2#post-37278</link>
			<pubDate>Sun, 13 May 2012 21:08:07 +0000</pubDate>
			<dc:creator>asm</dc:creator>
			<guid isPermaLink="false">37278@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;guys, your soln is a bit overengineered: this is a simple array transpose:&#60;/p&#62;
&#60;pre&#62;
int get_index(int idx, int N) {
    return (idx % 3) * N + (idx / 3);
}

void transform_array2(char *s[], int len) {
    int N = len / 3;
    for(int i = 0; i &#38;lt; len; i++) {
        int new_idx = get_index(i, N);
        while(new_idx &#38;lt; i) {
            new_idx = get_index(new_idx, N);
        }
        printf(&#34;i: %d; new_idx: %d\n&#34;, i, new_idx);
        std::swap(s[i], s[new_idx]);
    }
    for(int i = 0; i &#38;lt; len; i++) {
        printf(&#34;%s &#34;, s[i]);
    }
    printf(&#34;\n&#34;);
}
&#60;/pre&#62;</description>
		</item>
		<item>
			<title>asm on "find all increasing subsequences"</title>
			<link>http://geeksforgeeks.org/forum/topic/find-all-increasing-subsequences#post-37277</link>
			<pubDate>Sun, 13 May 2012 21:00:52 +0000</pubDate>
			<dc:creator>asm</dc:creator>
			<guid isPermaLink="false">37277@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;given an array of integers, we need to find all strictly increasing subsequences in this array.&#60;br /&#62;
A subsequence can start at any element and end at any element. &#60;/p&#62;
&#60;p&#62;Example:  {5,1,6,8,7,15,2,45,3,6}&#60;br /&#62;
then possible subsequences are:&#60;br /&#62;
[1 2 45 ]&#60;br /&#62;
[1 6 7 15 45 ]&#60;br /&#62;
[5 6 7 15 45 ]&#60;br /&#62;
[1 6 8 15 45 ]&#60;br /&#62;
[5 6 8 15 45 ]&#60;br /&#62;
[1 2 3 6 ]&#60;br /&#62;
[5 6 ]&#60;/p&#62;
&#60;p&#62;ps. I know there is a closely related problem where we need to find the *longest* increasing subsequence which can be solved in O(n log n) using DP approach. But here it seems that we cannot do better than O(n^2) ?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>asm on "verbal arithmetic"</title>
			<link>http://geeksforgeeks.org/forum/topic/verbal-arithmetic#post-37276</link>
			<pubDate>Sun, 13 May 2012 20:50:01 +0000</pubDate>
			<dc:creator>asm</dc:creator>
			<guid isPermaLink="false">37276@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;@apurv, you can have a look at my post &#34;numeric puzzle&#34;.&#60;br /&#62;
There is a recursive algo for that, you can modify it to ensure that no two alphabets get the same digit.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>apurv on "verbal arithmetic"</title>
			<link>http://geeksforgeeks.org/forum/topic/verbal-arithmetic#post-37275</link>
			<pubDate>Sun, 13 May 2012 16:42:27 +0000</pubDate>
			<dc:creator>apurv</dc:creator>
			<guid isPermaLink="false">37275@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;thanks for this.but i need the exact code in c++..
&#60;/p&#62;</description>
		</item>
		<item>
			<title>kartik on "verbal arithmetic"</title>
			<link>http://geeksforgeeks.org/forum/topic/verbal-arithmetic#post-37274</link>
			<pubDate>Sun, 13 May 2012 14:43:05 +0000</pubDate>
			<dc:creator>kartik</dc:creator>
			<guid isPermaLink="false">37274@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;See &#60;a href=&#34;http://see.stanford.edu/materials/icspacs106b/H19-RecBacktrackExamples.pdf&#34; rel=&#34;nofollow&#34;&#62;http://see.stanford.edu/materials/icspacs106b/H19-RecBacktrackExamples.pdf&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>GeeksforGeeks on "Google Interview Question"</title>
			<link>http://geeksforgeeks.org/forum/topic/google-interview-question-8#post-37273</link>
			<pubDate>Sun, 13 May 2012 14:30:04 +0000</pubDate>
			<dc:creator>GeeksforGeeks</dc:creator>
			<guid isPermaLink="false">37273@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;This has been published. Please see &#60;a href=&#34;http://www.geeksforgeeks.org/archives/19267&#34; rel=&#34;nofollow&#34;&#62;http://www.geeksforgeeks.org/archives/19267&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>apurv on "verbal arithmetic"</title>
			<link>http://geeksforgeeks.org/forum/topic/verbal-arithmetic#post-37272</link>
			<pubDate>Sun, 13 May 2012 10:27:57 +0000</pubDate>
			<dc:creator>apurv</dc:creator>
			<guid isPermaLink="false">37272@http://geeksforgeeks.org/forum/</guid>
			<description>&#60;p&#62;also known as cryptarithmetic is a type of puzzle where you have to assign digits to alphabets such that no two alphabets get the same digits.only numbers from 0 -9 can be assigned.ex&#60;br /&#62;
  send&#60;br /&#62;
+more=&#60;br /&#62;
money&#60;/p&#62;
&#60;p&#62;values after solving are:&#60;br /&#62;
 O = 0, M = 1, Y = 2, E = 5, N = 6, D = 7, R = 8, and S = 9
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>

