Re: [algogeeks] Re: MICROSOFT WRITTEN

2011-10-02 Thread Varun Jakhoria
return (((-1+!x)&y) | ((-1+!!x)&z)) ; On Sun, Oct 2, 2011 at 3:18 PM, ravi maggon wrote: > How about this answer: > b?z:y > > int main() { >     int a=0,b,y=4,z=5,k; >     cin>>b; >     k=(((b+~a+1)>>7)&1);//k will either be 0 or 1 >     cout<< (z-int((bool)k&(z-y))); >     return 0; > } > > On

Re: [algogeeks] Re: MICROSOFT WRITTEN

2011-10-02 Thread ravi maggon
How about this answer: b?z:y int main() { int a=0,b,y=4,z=5,k; cin>>b; k=(((b+~a+1)>>7)&1);//k will either be 0 or 1 cout<< (z-int((bool)k&(z-y))); return 0; } On Mon, Sep 12, 2011 at 5:32 PM, beginner wrote: > although multiplication operator is not allowed.. > but it's an

Re: [algogeeks] Re: MICROSOFT WRITTEN IN VASAVI

2011-09-15 Thread Dheeraj Sharma
char str[10]; int length,count; void fun(int x) { if(x==length) printf("%d %s\n",++count,str); else { fun(x+1); str[x]-=32; fun(x+1); str[x]+=32; } } int main() { scanf("%s",str); length=strlen(str); fun(0); getch(); }

Re: [algogeeks] Re: MICROSOFT WRITTEN IN VASAVI

2011-09-14 Thread mohit verma
take an array containing all original upper-case letters and their smaller case letters and now the problem is reduced to print all substrings containing length of original string. On Wed, Sep 14, 2011 at 8:55 PM, teja bala wrote: > > //dis one works check it out.. > > #include > #in

Re: [algogeeks] Re: MICROSOFT WRITTEN IN VASAVI

2011-09-14 Thread teja bala
//dis one works check it out.. #include #include #include #include void toggler(char* x, int pos) { if(pos==0){ printf("%s\n",x); return; } // printf("String is now: %s\n",x); x[pos-1] = toupper(x[pos-1]); toggler(x, pos-1); x[pos-1] = tolower(x[pos-1]); toggler(x, pos-1

Re: [algogeeks] Re: MICROSOFT WRITTEN IN VASAVI

2011-09-14 Thread Shravan Kumar
1 wahat is the logic why 1< > > On Wed, Sep 14, 2011 at 6:44 PM, teja bala wrote: > >> @DAVE >> >> dis was the o/p for ur prog. >> >> aBC >> abC >> abC >> abc >> abc >> abc >> abc >> abc >> >> #include >> main() >> { >> int i, n = 3; >> char *s="ABC"; >> for( i = 0 ; i < (1<> { >> s[i^(i

Re: [algogeeks] Re: MICROSOFT WRITTEN IN VASAVI

2011-09-14 Thread UTKARSH SRIVASTAV
wahat is the logic why 1 @DAVE > > dis was the o/p for ur prog. > > aBC > abC > abC > abc > abc > abc > abc > abc > > #include > main() > { > int i, n = 3; > char *s="ABC"; > for( i = 0 ; i < (1< { > s[i^(i>>1)] ^= 'a' ^ 'A'; > cout << s << endl; > } > } > > > > -- > You received this

Re: [algogeeks] Re: MICROSOFT WRITTEN IN VASAVI

2011-09-14 Thread teja bala
@DAVE dis was the o/p for ur prog. aBC abC abC abc abc abc abc abc #include main() { int i, n = 3; char *s="ABC"; for( i = 0 ; i < (1<>1)] ^= 'a' ^ 'A'; cout << s << endl; } } -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to thi

Re: [algogeeks] Re: Microsoft written!!!

2011-09-07 Thread Neha Sharan
12 On Wed, Sep 7, 2011 at 8:46 AM, Vikram Singh wrote: > i m asking again, cos no one replied earlier: > > in example given by mohit... is the leftmost right cousin of 8 and 9, > NULL or > 12?? > > > On Aug 27, 6:42 pm, aditi garg wrote: > > This grp is full of MS interview ques..search the arch

Re: [algogeeks] Re: Microsoft written!!!

2011-08-27 Thread aditi garg
This grp is full of MS interview ques..search the archives... On Sat, Aug 27, 2011 at 6:55 PM, teja bala wrote: > > > if any one aware of microsoft written test please give me the suggestions > and respective links > thx. > > -- > You received this message because you are subscribed t

Re: [algogeeks] Re: Microsoft written!!!

2011-08-27 Thread teja bala
if any one aware of microsoft written test please give me the suggestions and respective links thx. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe fr

Re: [algogeeks] Re: Microsoft Written Test Questions

2011-08-10 Thread payal gupta
do reply if u have it On Thu, Aug 11, 2011 at 12:24 AM, Brijesh Upadhyay < brijeshupadhyay...@gmail.com> wrote: > Yeah...please share questions..it will be of a lot help! > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view th

Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread Brijesh Upadhyay
thank u , i couldnot have answered this :P -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/Gppo1P-Gr9oJ. To post to this group, send email to algogeeks@goo

Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread Mohit Goel
@muthu raj: it will also come out ,when loop condition will not be statisfied.i.e when 'p' is not the right child of its parent...in such a case it will not reach root .. in the ex given by u it will stop at 4 . -- You received this message because you are subscribed to the Google Groups "Algo

Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread muthu raj
Tell me if this Pseudo code Works. Initial conditions tp be checked are: node * leftmostRightCousin(node *root,node *p) { if(root==p || root->left==p || root->right==p) // in dis case der cant be any cousins for any node at first level. return NULL;

Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread muthu raj
@Mohit : in ur code u are breaking out when there parent reaches root. But not every time will we have to reach root. For example: Leftmost right cousin of 1 is 9...in dat case parent should stop at 4. which is not the root. *Muthuraj R IV th Year , ISE PESIT , Bangalore* On Wed, Aug 10, 2011 a

Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread muthu raj
@coder dumca: If u apply DFS u will get a brother and not cousin. And yes it works only for some cases. *Muthuraj R IV th Year , ISE PESIT , Bangalore* On Wed, Aug 10, 2011 at 2:24 PM, coder dumca wrote: > apply BFS > the node after the particular node(whode cousin to be find) will be the > r

Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread coder dumca
apply BFS the node after the particular node(whode cousin to be find) will be the required node On Wed, Aug 10, 2011 at 2:15 PM, Puneet Chawla wrote: > > Agree with mohit goel.. > > On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel wrote: > >>10 >> 4

Re: [algogeeks] Re: Microsoft written!!!

2011-08-10 Thread Puneet Chawla
Agree with mohit goel.. On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel wrote: >10 > 4 5 >2 7 6 11 >1 39 8 12 13 14 15 > > > i think we should first find the parent of the particular no

Re: [algogeeks] Re: Microsoft written!!!

2011-08-09 Thread Mohit Goel
10 4 5 2 7 6 11 1 39 8 12 13 14 15 i think we should first find the parent of the particular node ..then apply the concept as told by Brijesh on it p =parent(q); r = parent(p); c

Re: [algogeeks] Re: Microsoft written!!!

2011-08-09 Thread Anika Jain
ah.. my mistake sorry On Tue, Aug 9, 2011 at 9:24 PM, Anika Jain wrote: > @brijesh: if we have to find leftmost right cousin for 9 in the same tree.. > then it shall be 8.. but 9 is in right subtree of 7.. > > > On Tue, Aug 9, 2011 at 2:11 PM, Brijesh Upadhyay < > brijeshupadhyay...@gmail.com> w

Re: [algogeeks] Re: Microsoft written!!!

2011-08-09 Thread Dhriti Khanna
I think leftmost right cousin of 9 should be NULL. Because 8 is its immediate brother, and not cousin. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this g

Re: [algogeeks] Re: Microsoft written!!!

2011-08-09 Thread Anika Jain
@brijesh: if we have to find leftmost right cousin for 9 in the same tree.. then it shall be 8.. but 9 is in right subtree of 7.. On Tue, Aug 9, 2011 at 2:11 PM, Brijesh Upadhyay < brijeshupadhyay...@gmail.com> wrote: > 10 > 4 5 >2

Re: [algogeeks] Re: Microsoft Written test questions required

2011-03-13 Thread HARISH S.C
@Akshata Hi Sorry for late reply. Amrita School Of Engineering,Coimbatore On Sun, Feb 13, 2011 at 10:04 AM, Akshata Sharma wrote: > @harish: > which college? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group,

Re: [algogeeks] Re: Microsoft Written test questions required

2011-02-12 Thread HARISH S.C
We had MS interview on 22nd jan.Written test was very easy. We had 2 technical question 1.Convert an decimal integer to binary string(10 marks) 2.sort a doubly linked list(5 marks) 2 very easy apti question for 5 marks like there are 20 people in party. each one shakes hand with others twice, the

Re: [algogeeks] Re: Microsoft Written Test Questions

2011-01-30 Thread Anurag Bhatia
Does anyone have details of whether the test was conducted on the 30th? If yes, which city? --AB On Thu, Jan 27, 2011 at 5:33 PM, Rahul Menon wrote: > This time MS rather than conducting the written tests by itself has > outsourced the procedure to MERITTRAC Services to be conducted to jan > 30t