Re: [algogeeks] Microsoft Interview Qn - Looping

2011-07-20 Thread Kamakshii Aggarwal
please some1 tell how to do part 2.

On Wed, Jul 20, 2011 at 6:20 PM, kavitha nk  wrote:

> for 3rd v can replace decrement by an increment operator!
>
>
>
>
>
> //BE COOL//   kavi
>
>  --
> 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.
>



-- 
Regards,
Kamakshi
kamakshi...@gmail.com

-- 
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] Microsoft Interview Qn - Looping

2011-07-20 Thread kavitha nk
for 3rd v can replace decrement by an increment operator!





//BE COOL//   kavi

-- 
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] Microsoft Interview Qn - Looping

2011-07-19 Thread naveen ms
yup...thank u:)

-- 
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] Microsoft Interview Qn - Looping

2011-07-19 Thread oppilas .
Naveen indeed it's not infinite loop but it will print MS 2^31+1 times,
right ? :)
Change it so that it prints it 20 times.

On Wed, Jul 20, 2011 at 7:39 AM, naveen ms  wrote:

> excuse me...can any explain y it goes to infinite loop..
>
> with regards
> naveen
>
> --
> 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] Microsoft Interview Qn - Looping

2011-07-19 Thread naveen ms
excuse me...can any explain y it goes to infinite loop..

with regards
naveen

-- 
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] Microsoft Interview Qn - Looping

2011-07-19 Thread Anisha Mazumder
how to solve part 2?

On Tue, Jul 19, 2011 at 4:16 PM, hary rathor  wrote:

> n ; ~n
>
> --
> 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] Microsoft Interview Qn - Looping

2011-07-19 Thread hary rathor
n ; ~n

-- 
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] Microsoft Interview Qn - Looping

2011-07-19 Thread Radhika Renganathan
i know 3 solns!

1)  int n = 20;
  int i;
  for (i=0; i+n; i--)
  printf("MS");
2)  int n = 20;
  int i;
  for (i=0; i wrote:

> Given the following program, "MS" will be printed, infinite number of
> times:
>   int n = 20;
>   int i;
>   for (i=0; i   printf("MS");
>
>  Apply one of the following three operations one at a time such that
>"MS" can be printed 20 times.
>1. You can add only one character into it.
>2. you can delete only one character in it.
>3. You can replace a character by another character.
>
>  Find all possible solutions for this problem.
>
> --
> 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.
>
>


-- 
 radhika .. :)

-- 
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.



[algogeeks] Microsoft Interview Qn - Looping

2011-07-19 Thread Reynald
Given the following program, "MS" will be printed, infinite number of
times:
   int n = 20;
   int i;
   for (i=0; ihttp://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Microsoft Interview Qn

2011-07-17 Thread Ashish Goel
1. PUSH ROOT IN Q
2. PUSH DUMMY NODE IN Q, DEFINE PREVIOUS NODE AS NULL
3. WHILE Q IS NOT EMPTY
3A. POP CURRENT NODE
3B. IF CURRENT NODE IS NOT DUMMY
3B1. IF PREVIOUS, PREVIOUS->SIBLING = CURRENT.
3B2. PREVIOUS = CURRENT
3B3. PUSH CURRENT->LEFT, CURRENT->RIGHT TO Q (ONLY IF THE NODES ARE NOT
NULL)
3C IF CURRENT NODE IS DUMMY
3C1 IF PREVIOUS, PREVIOUS->SIBLING = NULL;
3C2 PUSH DUMMY ON Q



Best Regards
Ashish Goel
"Think positive and find fuel in failure"
+919985813081
+919966006652


On Sat, Jul 16, 2011 at 4:16 PM, Reynald  wrote:

> Given a Parent -Child binary tree ,build the child -sibling version of
> it?
> Minimize the space requirements wherever possible.
>
> --
> 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] Microsoft Interview Qn

2011-07-16 Thread shady
always state one input output while asking questions  sample
input-output ?

On Sat, Jul 16, 2011 at 4:16 PM, Reynald  wrote:

> Given a Parent -Child binary tree ,build the child -sibling version of
> it?
> Minimize the space requirements wherever possible.
>
> --
> 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.



[algogeeks] Microsoft Interview Qn

2011-07-16 Thread Reynald
Given a Parent -Child binary tree ,build the child -sibling version of
it?
Minimize the space requirements wherever possible.

-- 
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.