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;
cinb;
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 shubh2...@gmail.com wrote:

 although multiplication operator is not allowed..
 but it's an attempt to write shorter...

 c++ implementation-

 int cond(int x, int y, int z){
  return  y*(int)((bool)x)+z*(1+(~(int)((bool)x)+1));

 }

 --
 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/-/5uGBGvacNEwJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Regards
Ravi Maggon
B.E. CSE, Final Year
Thapar University

www.algorithmguru.com

*Failure is the opportunity to begin again more intelligently*

-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 maggonr...@gmail.com wrote:
 How about this answer:
 b?z:y

 int main() {
     int a=0,b,y=4,z=5,k;
     cinb;
     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 shubh2...@gmail.com wrote:

 although multiplication operator is not allowed..
 but it's an attempt to write shorter...

 c++ implementation-

 int cond(int x, int y, int z){
  return  y*(int)((bool)x)+z*(1+(~(int)((bool)x)+1));
 }

 --
 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/-/5uGBGvacNEwJ.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



 --
 Regards
 Ravi Maggon
 B.E. CSE, Final Year
 Thapar University

 www.algorithmguru.com

 Failure is the opportunity to begin again more intelligently

 --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Varun Jakhoria
...it's only about 0's  1's

-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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();
}

On Wed, Sep 14, 2011 at 10:05 AM, mohit verma mohit89m...@gmail.com wrote:

 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 pawanjalsa.t...@gmail.comwrote:


 //dis one works check it out..

 #includectype.h
 #includestdio.h
 #includestring.h
 #includeassert.h
 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);
 return;
 }
 int main(void){
   char str[500];
   scanf(%s,str);
   toggler(str, strlen(str));
   return 0;
  }

 On Wed, Sep 14, 2011 at 7:22 PM, Dave dave_and_da...@juno.com wrote:

 @Teja: Oops. I was wrong. By the time I fix my conceptual error, the
 code is no shorter than Anshu's.

 Dave

 On Sep 14, 8:14 am, teja bala pawanjalsa.t...@gmail.com wrote:
  @DAVE
 
  dis was the o/p for ur prog.
 
  aBC
  abC
  abC
  abc
  abc
  abc
  abc
  abc
 
  #includeiostream.h
  main()
  {
  int i, n = 3;
  char *s=ABC;
  for( i = 0 ; i  (1n) ; ++i )
  {
   s[i^(i1)] ^= 'a' ^ 'A';
   cout  s  endl;
 
 
 
  }
  }- Hide quoted text -
 
  - Show quoted text -

 --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 
 *MOHIT VERMA*

  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
*Dheeraj Sharma*
Comp Engg.
NIT Kurukshetra

-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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

#includeiostream.h
main()
{
int i, n = 3;
char *s=ABC;
for( i = 0 ; i  (1n) ; ++i )
{
 s[i^(i1)] ^= 'a' ^ 'A';
 cout  s  endl;
}
}

-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MICROSOFT WRITTEN IN VASAVI

2011-09-14 Thread UTKARSH SRIVASTAV
wahat is the logic why 1n?

On Wed, Sep 14, 2011 at 6:44 PM, teja bala pawanjalsa.t...@gmail.comwrote:

 @DAVE

 dis was the o/p for ur prog.

 aBC
 abC
 abC
 abc
 abc
 abc
 abc
 abc

 #includeiostream.h
 main()
 {
 int i, n = 3;
 char *s=ABC;
 for( i = 0 ; i  (1n) ; ++i )
 {
  s[i^(i1)] ^= 'a' ^ 'A';
  cout  s  endl;
  }
 }



  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
*UTKARSH SRIVASTAV
CSE-3
B-Tech 3rd Year
@MNNIT ALLAHABAD*

-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MICROSOFT WRITTEN IN VASAVI

2011-09-14 Thread Shravan Kumar
1n = 2 power n, total number of possible strings

On Wed, Sep 14, 2011 at 7:00 PM, UTKARSH SRIVASTAV
usrivastav...@gmail.comwrote:

 wahat is the logic why 1n?


 On Wed, Sep 14, 2011 at 6:44 PM, teja bala pawanjalsa.t...@gmail.comwrote:

 @DAVE

 dis was the o/p for ur prog.

 aBC
 abC
 abC
 abc
 abc
 abc
 abc
 abc

 #includeiostream.h
 main()
 {
 int i, n = 3;
 char *s=ABC;
 for( i = 0 ; i  (1n) ; ++i )
 {
  s[i^(i1)] ^= 'a' ^ 'A';
  cout  s  endl;
  }
 }



  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 *UTKARSH SRIVASTAV
 CSE-3
 B-Tech 3rd Year
 @MNNIT ALLAHABAD*


  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: MICROSOFT WRITTEN IN VASAVI

2011-09-14 Thread teja bala
//dis one works check it out..

#includectype.h
#includestdio.h
#includestring.h
#includeassert.h
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);
return;
}
int main(void){
  char str[500];
  scanf(%s,str);
  toggler(str, strlen(str));
  return 0;
}

On Wed, Sep 14, 2011 at 7:22 PM, Dave dave_and_da...@juno.com wrote:

 @Teja: Oops. I was wrong. By the time I fix my conceptual error, the
 code is no shorter than Anshu's.

 Dave

 On Sep 14, 8:14 am, teja bala pawanjalsa.t...@gmail.com wrote:
  @DAVE
 
  dis was the o/p for ur prog.
 
  aBC
  abC
  abC
  abc
  abc
  abc
  abc
  abc
 
  #includeiostream.h
  main()
  {
  int i, n = 3;
  char *s=ABC;
  for( i = 0 ; i  (1n) ; ++i )
  {
   s[i^(i1)] ^= 'a' ^ 'A';
   cout  s  endl;
 
 
 
  }
  }- Hide quoted text -
 
  - Show quoted text -

 --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 pawanjalsa.t...@gmail.comwrote:


 //dis one works check it out..

 #includectype.h
 #includestdio.h
 #includestring.h
 #includeassert.h
 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);
 return;
 }
 int main(void){
   char str[500];
   scanf(%s,str);
   toggler(str, strlen(str));
   return 0;
 }

 On Wed, Sep 14, 2011 at 7:22 PM, Dave dave_and_da...@juno.com wrote:

 @Teja: Oops. I was wrong. By the time I fix my conceptual error, the
 code is no shorter than Anshu's.

 Dave

 On Sep 14, 8:14 am, teja bala pawanjalsa.t...@gmail.com wrote:
  @DAVE
 
  dis was the o/p for ur prog.
 
  aBC
  abC
  abC
  abc
  abc
  abc
  abc
  abc
 
  #includeiostream.h
  main()
  {
  int i, n = 3;
  char *s=ABC;
  for( i = 0 ; i  (1n) ; ++i )
  {
   s[i^(i1)] ^= 'a' ^ 'A';
   cout  s  endl;
 
 
 
  }
  }- Hide quoted text -
 
  - Show quoted text -

 --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 

*MOHIT VERMA*

-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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

2011-09-07 Thread Neha Sharan
12

On Wed, Sep 7, 2011 at 8:46 AM, Vikram Singh singhvikram...@gmail.comwrote:

 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 aditi.garg.6...@gmail.com wrote:
  This grp is full of MS interview ques..search the archives...
 
  On Sat, Aug 27, 2011 at 6:55 PM, teja bala pawanjalsa.t...@gmail.com
 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 to the Google
 Groups
   Algorithm Geeks group.
   To post to this group, send email to algogeeks@googlegroups.com.
   To unsubscribe from this group, send email to
   algogeeks+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/algogeeks?hl=en.
 
  --
  Aditi Garg
  Undergraduate Student
  Electronics  Communication Divison
  NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
  Sector 3, Dwarka
  New Delhi

 --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 pawanjalsa.t...@gmail.comwrote:



 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 from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Aditi Garg
Undergraduate Student
Electronics  Communication Divison
NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
Sector 3, Dwarka
New Delhi

-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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

2011-08-10 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);
count =1;
while(p ==isright(r))
{
p=r;
r=parent(r);
count++;
if(r==root)
break;

}

if(d =right(r))
{
while(count!=0)
{
if(d-left)
d=d-left;
else d=d-right;
count--;
}
}
else return NULL;
o/p=d-value;

-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 mohitgoel291...@gmail.comwrote:

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);
 count =1;
 while(p ==isright(r))
 {
 p=r;
 r=parent(r);
 count++;
 if(r==root)
 break;

 }

 if(d =right(r))
 {
 while(count!=0)
 {
 if(d-left)
 d=d-left;
 else d=d-right;
 count--;
 }
 }
 else return NULL;
 o/p=d-value;



  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
With regards
  
Puneet Chawla
Computer Engineering Student
NIT Kurukshetra

-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 puneetchawla...@gmail.comwrote:


 Agree with mohit goel..

 On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel mohitgoel291...@gmail.comwrote:

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);
 count =1;
 while(p ==isright(r))
 {
 p=r;
 r=parent(r);
 count++;
 if(r==root)
 break;

 }

 if(d =right(r))
 {
 while(count!=0)
 {
 if(d-left)
 d=d-left;
 else d=d-right;
 count--;
 }
 }
 else return NULL;
 o/p=d-value;



  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 With regards
   
 Puneet Chawla
 Computer Engineering Student
 NIT Kurukshetra

  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 coder.du...@gmail.com wrote:

 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 
 puneetchawla...@gmail.comwrote:


 Agree with mohit goel..

 On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel 
 mohitgoel291...@gmail.comwrote:

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);
 count =1;
 while(p ==isright(r))
 {
 p=r;
 r=parent(r);
 count++;
 if(r==root)
 break;

 }

 if(d =right(r))
 {
 while(count!=0)
 {
 if(d-left)
 d=d-left;
 else d=d-right;
 count--;
 }
 }
 else return NULL;
 o/p=d-value;



  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 With regards
   
 Puneet Chawla
 Computer Engineering Student
 NIT Kurukshetra

  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 at 3:26 PM, muthu raj muthura...@gmail.com wrote:

 @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 coder.du...@gmail.comwrote:

 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 puneetchawla...@gmail.com
  wrote:


 Agree with mohit goel..

 On Wed, Aug 10, 2011 at 11:22 AM, Mohit Goel 
 mohitgoel291...@gmail.comwrote:

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);
 count =1;
 while(p ==isright(r))
 {
 p=r;
 r=parent(r);
 count++;
 if(r==root)
 break;

 }

 if(d =right(r))
 {
 while(count!=0)
 {
 if(d-left)
 d=d-left;
 else d=d-right;
 count--;
 }
 }
 else return NULL;
 o/p=d-value;



  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 With regards
   
 Puneet Chawla
 Computer Engineering Student
 NIT Kurukshetra

  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


  --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 this discussion on the web visit
 https://groups.google.com/d/msg/algogeeks/-/cs4XYfgJrooJ.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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  7  6 11
1 39   8 12  13   14   15
 let u have to fine leftmost right cousin of 8 . , move up , u get 10 as the
 ancestor , such that its left subtree contains 8 , unlike 7 ,4 (whose right
 subtree contains 8)!   now no of level u moved is 3 .. then traverse in
 the right subtree of 10 , and find left most node , by moving down 3 levels,
 and u get 12 as ur answer...

 --
 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/-/Lftrcml-FS0J.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.


-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 anika.jai...@gmail.com 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 wrote:

  10
  4  5
2  7  6 11
1 39   8 12  13   14   15
 let u have to fine leftmost right cousin of 8 . , move up , u get 10 as
 the ancestor , such that its left subtree contains 8 , unlike 7 ,4 (whose
 right subtree contains 8)!   now no of level u moved is 3 .. then
 traverse in the right subtree of 10 , and find left most node , by moving
 down 3 levels, and u get 12 as ur answer...

 --
 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/-/Lftrcml-FS0J.

 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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
akshatasharm...@gmail.comwrote:

 @harish:
 which college?

 --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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, then how many hand shakes were
there,etc.

2 DBMS question. They are choose the best for 1 mark each. A query for 3
marks.

answers to following questions are what matters a lot

1. U r watching an inp. cricket match.Suddenly the tv goes blank. Write the
steps u ll take to find the fault(5 marks)
2. Due to fog, airplanes were unable to land and were circling the airport.
Few airplanes are about to run out of fuel, what are the short term and log
term measures you will take.(5 Marks)
3.Write test cases for a car(10 Mark)
4. You are the administrator of a server which carries sensitive information
abt the company. What are the possible attacks and how will you prevent
it.(5 marks)


They tested how u think more than your technical skill when they came to our
college. Be ready to answer some puzzles. They will give a lot of importance
to your GPA during final interview process

All the best !!

Regards,
S.C.Harish

On Thu, Feb 3, 2011 at 3:56 PM, Avik Mitra tutai...@gmail.com wrote:

 Try to solve GATE question papers on data structures, tress DBMS and
 OS. Also try to solve exploring C.

 --
 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 group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



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 menonrahul1...@gmail.com wrote:
 This time MS rather than conducting the written tests by itself has
 outsourced the procedure to MERITTRAC Services to be conducted to jan
 30th, So unlike the regular 6 questions type written test , it will be
 replaced by MCQs which is the regular pattern of merittrac tests
 [think so] . From a bit googling I came to know that these people put
 lot of repeated questions and each time and if we can get questions
 from previously conducted tests of  MS , it can be very helpful.

 So the ones with experience with merritrac tests here ,can do a lot
 help,

 I would also like to know about the pattern or topics they usually
 test. And also sample questions



 Regards,

 Rahul

 --
 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 group, send email to 
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/algogeeks?hl=en.



-- 
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 group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.