Re: [algogeeks] max sum b/w 2 leaf nodes in a binary tree

2012-08-27 Thread Ravi Maggon
@atul
I think he is asking for max. sum of elements between 2 leaf nodes and not
the max distance between two nodes.

On Sun, Aug 26, 2012 at 6:12 PM, atul anand atul.87fri...@gmail.com wrote:

 its the diameter of tree.
 you can find implementation on geeksforgeeks

 On 8/25/12, kunal rustgi rustogi.ku...@gmail.com wrote:
  Hi,
 
  Can anyone suggest the best approach for finding max sum b/w 2 leaf nodes
  in a binary tree ( not BST )  ?
 
  --
  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.




-- 



*Regards
*Ravi Maggon

Member Technical - IT/Front Office

D.E. Shaw  Co.

-- 
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] Suggest algo...

2012-08-27 Thread Ravi Maggon
keep a hash to check if digit is already used for that combination or not.
add this logic to existing combinations generator code.

On Sat, Aug 25, 2012 at 12:34 AM, amrit harry dabbcomput...@gmail.comwrote:

  find the all possible combination of digits ranging 1 to 9 whose sum is
 10,
 no digit shud be repeated in any combination.
 1234
 127
 136
 145
 19
 235
 28
 37
 46

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

Member Technical - IT/Front Office

D.E. Shaw  Co.

-- 
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] Duplicate file in all computers in a network

2012-08-27 Thread Ravi Maggon
This problem is similar to one to all broadcast in parallel computing.
Imagine all the nodes in form of hypercube.

On Wed, Aug 22, 2012 at 2:04 PM, Karthikeyan V.B kartmu...@gmail.comwrote:

  A network of N computers is such that each computer is connected to
 every other.Transferring one byte of information between two computers
 takes one unit of time. In the beginning, a file resides on only one
 computer on the network. The size of the file is M bytes. Come up with a
 strategy to duplicate this file across all N machines {that is each machine
 should have a local copy of the file} in minimum amount of time.

 --
 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
*Ravi Maggon

Member Technical - IT/Front Office

D.E. Shaw  Co.

-- 
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] Indus Valley Partners Paper Pattern

2012-08-25 Thread Ravi Maggon
please go through this blog
http://interviewdestiny.blogspot.in/2011/11/indus-valley-partners-procedure-in-2011.html

it shows the coding problems asked but I don't remember the apti ques.

On Mon, Aug 20, 2012 at 10:53 PM, vipul jain vjvipu...@gmail.com wrote:

 yar i forgot those coding question
 and there were 20 question and covering each and every topic of apti
 but u shud score 18 out of it becoz simole hote h vo

 On Mon, Aug 20, 2012 at 7:37 PM, Arun Kindra arunkin...@gmail.com wrote:

 Is it for campus recruitment process or Off campus?
 And can u specify the Apti topic, and is there any analytical reasoning?
 If possible plz share Coding ques.

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




 --
 Thanks  Regards
 Vipul Jain
 lVth yr
 Information Technology
 Nit Jaipur

  --
 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
*Ravi Maggon

Member Technical - IT/Front Office

D.E. Shaw  Co.

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



[algogeeks] indus valley partner doubt

2011-09-28 Thread ravi maggon
Hey can anyone tell me about the procedure and questions of Indus Valley
Partners??

-- 
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] C OUTPUT

2011-09-21 Thread ravi maggon
output is -4 -1
int a:1 signifies that only 1 bit will be stored for a and since we have
only 1 bit so it will serve as sign bit and we get obj.a as -1
similarly for int b:3, 3 bits will be used to store b. 12 is 1100. we save
only 3 bits i.e. 100 where msb signifies the sign i.e. no. is negative. But
I am not able to represent the value -4 in 3 bits. Can anyone elaborate?
I think 00 is getting converted to 2's complement which is 100 = 4 and we
have negative sign bit set. So ans is -4. Correct me if I am wrong.

On Wed, Sep 21, 2011 at 10:22 PM, kartik sachan kartik.sac...@gmail.comwrote:


 int main(){
 struct {
 int a:1;
 int b:3;
 }obj;
 obj.b=12;
 obj.a=7;
 printf 
 http://www.opengroup.org/onlinepubs/009695399/functions/printf.html(%d 
 %d,obj.b,obj.a);return 0;}



 can anybody explain the output
 plzz also show how no's are stored


 --

 *WITH REGARDS,*
 *
 *
 *KARTIK SACHAN*

 *B.TECH 3rd YEAR*
 *COMPUTER SCIENCE AND ENGINEERING*
 *NIT 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.




-- 
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] INFORMATICAA...........PLZ HELP !!

2011-09-21 Thread ravi maggon
most of questions are already discussed. Search previous threads or my
posts.

On Wed, Sep 21, 2011 at 10:03 PM, vijay singh vijaysinghb...@gmail.comwrote:

 It will be asking questions from C, C++ and DS (mainly).
 Here is the feedback, you can download it...

  --
 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
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] plz help

2011-09-21 Thread ravi maggon
Output Hello printed 10 times. Since form command spawns the process, so for
every call their are two process created and since if process gets
successfully created fork returns some positive no. which is the process id,
so it will break the loop and finally only the 10 child processes will be
left which will print Hello 10 times. I hope that I cleared your doubt.

On Thu, Sep 22, 2011 at 12:03 AM, Anil Arya anilarya...@gmail.com wrote:

 http://ideone.com/nkTVN


 On Wed, Sep 21, 2011 at 11:43 PM, Saravana kumar 
 saravana@gmail.comwrote:

 Hello will be printed 45 times...


 On Wed, Sep 21, 2011 at 7:57 PM, sush57 sushaant...@gmail.com wrote:

 main()
 {
int tmp;
for(i=0;i9;i++)
{
tmp=fork();
if(tmp0)
break;
printf(Hello);
}
 }


 what's the output and how does this work

 can u give few other questions using fork...

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




 --
 *Anil  Arya,
 Computer Science *
 *Motilal Nehru National Institute of Technology,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.




-- 
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] plz help

2011-09-21 Thread ravi maggon
ohh sorry, I thought it was i=9. Yes only 9 times Hello will be printed.

On Thu, Sep 22, 2011 at 12:52 AM, Rashmi Jain rashmi.jain...@gmail.comwrote:

 @ravi
 can u plz explain how 10 processes are created..? shouldn't it be 9..??

 On Thu, Sep 22, 2011 at 12:23 AM, ravi maggon maggonr...@gmail.comwrote:

 Output Hello printed 10 times. Since form command spawns the process, so
 for every call their are two process created and since if process gets
 successfully created fork returns some positive no. which is the process id,
 so it will break the loop and finally only the 10 child processes will be
 left which will print Hello 10 times. I hope that I cleared your doubt.


 On Thu, Sep 22, 2011 at 12:03 AM, Anil Arya anilarya...@gmail.comwrote:

 http://ideone.com/nkTVN


 On Wed, Sep 21, 2011 at 11:43 PM, Saravana kumar saravana@gmail.com
  wrote:

 Hello will be printed 45 times...


 On Wed, Sep 21, 2011 at 7:57 PM, sush57 sushaant...@gmail.com wrote:

 main()
 {
int tmp;
for(i=0;i9;i++)
{
tmp=fork();
if(tmp0)
break;
printf(Hello);
}
 }


 what's the output and how does this work

 can u give few other questions using fork...

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




 --
 *Anil  Arya,
 Computer Science *
 *Motilal Nehru National Institute of Technology,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.




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


  --
 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
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] plz help

2011-09-21 Thread ravi maggon
This is the output I am getting

   -

   result: Success time: 0smemory: 1720 kB returned value: 0
input: no
output:

   HelloHelloHelloHelloHelloHelloHelloHelloHelloHello




On Thu, Sep 22, 2011 at 1:40 AM, teja bala pawanjalsa.t...@gmail.comwrote:

 @ ravi but compile it on http://ideone.com/nkTVN  it showing 45 hello plz
 do look at it...


 On Thu, Sep 22, 2011 at 12:59 AM, Rashmi Jain rashmi.jain...@gmail.comwrote:

 @ravi: thanks..!!


 On Thu, Sep 22, 2011 at 12:54 AM, ravi maggon maggonr...@gmail.comwrote:

 ohh sorry, I thought it was i=9. Yes only 9 times Hello will be printed.


 On Thu, Sep 22, 2011 at 12:52 AM, Rashmi Jain 
 rashmi.jain...@gmail.comwrote:

 @ravi
 can u plz explain how 10 processes are created..? shouldn't it be 9..??

 On Thu, Sep 22, 2011 at 12:23 AM, ravi maggon maggonr...@gmail.comwrote:

 Output Hello printed 10 times. Since form command spawns the process,
 so for every call their are two process created and since if process gets
 successfully created fork returns some positive no. which is the process 
 id,
 so it will break the loop and finally only the 10 child processes will be
 left which will print Hello 10 times. I hope that I cleared your doubt.


 On Thu, Sep 22, 2011 at 12:03 AM, Anil Arya anilarya...@gmail.comwrote:

 http://ideone.com/nkTVN


 On Wed, Sep 21, 2011 at 11:43 PM, Saravana kumar 
 saravana@gmail.com wrote:

 Hello will be printed 45 times...


 On Wed, Sep 21, 2011 at 7:57 PM, sush57 sushaant...@gmail.comwrote:

 main()
 {
int tmp;
for(i=0;i9;i++)
{
tmp=fork();
if(tmp0)
break;
printf(Hello);
}
 }


 what's the output and how does this work

 can u give few other questions using fork...

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




 --
 *Anil  Arya,
 Computer Science *
 *Motilal Nehru National Institute of Technology,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.




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


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


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

Re: [algogeeks] Re: plz help

2011-09-21 Thread ravi maggon
I tried to run code on Mac Os and getting output as 9 times Hello.

On Thu, Sep 22, 2011 at 9:19 AM, siva viknesh sivavikne...@gmail.comwrote:

 expected op is 9 .. since on each iteration parent process gets
 cancelled out (its pid  0 ) and child process alone prints hello ..
 no chance of getting 10 or any other output .. correct me if m wrong !

 On Sep 22, 8:31 am, siva viknesh sivavikne...@gmail.com wrote:
  if anybody knows other good online compilers try to post ... codepad
  doesn't support fork
 
  On Sep 22, 8:29 am, siva viknesh sivavikne...@gmail.com wrote:
 
 
 
 
 
 
 
  http://ideone.com/l5ek4 .. in this it had shown 6
 
  http://ideone.com/Lj56O .. here 10 
 
   On Sep 22, 8:27 am, siva viknesh sivavikne...@gmail.com wrote:
 
somebody try to execute in linux and try to find the
 output...expected
output is 9but when first in ideone without \n in printf it
 showed
7 .. then with \n it showed 10... again with \n it showed 10 !!! ..
whether its prob with compiler or fork's execution is differing i'm
confused :(
 
On Sep 22, 1:34 am, Rashmi Jain rashmi.jain...@gmail.com wrote:
 
 but in this output 10  times hello is printed..how..??
 
 On Thu, Sep 22, 2011 at 1:52 AM, ravi maggon maggonr...@gmail.com
 wrote:
  This is the output I am getting
 
 -
 
 result: Success time: 0smemory: 1720 kB returned
 value: 0
  input: no
  output:
 
 HelloHelloHelloHelloHelloHelloHelloHelloHelloHello
 
  On Thu, Sep 22, 2011 at 1:40 AM, teja bala 
 pawanjalsa.t...@gmail.comwrote:
 
  @ ravi but compile it onhttp://ideone.com/nkTVN it showing 45
 hello plz
  do look at it...
 
  On Thu, Sep 22, 2011 at 12:59 AM, Rashmi Jain 
 rashmi.jain...@gmail.comwrote:
 
  @ravi: thanks..!!
 
  On Thu, Sep 22, 2011 at 12:54 AM, ravi maggon 
 maggonr...@gmail.comwrote:
 
  ohh sorry, I thought it was i=9. Yes only 9 times Hello will
 be
  printed.
 
  On Thu, Sep 22, 2011 at 12:52 AM, Rashmi Jain 
 rashmi.jain...@gmail.com
   wrote:
 
  @ravi
  can u plz explain how 10 processes are created..? shouldn't
 it be 9..??
 
  On Thu, Sep 22, 2011 at 12:23 AM, ravi maggon 
 maggonr...@gmail.comwrote:
 
  Output Hello printed 10 times. Since form command spawns the
 process,
  so for every call their are two process created and since if
 process gets
  successfully created fork returns some positive no. which is
 the process id,
  so it will break the loop and finally only the 10 child
 processes will be
  left which will print Hello 10 times. I hope that I cleared
 your doubt.
 
  On Thu, Sep 22, 2011 at 12:03 AM, Anil Arya 
 anilarya...@gmail.comwrote:
 
 http://ideone.com/nkTVN
 
  On Wed, Sep 21, 2011 at 11:43 PM, Saravana kumar 
  saravana@gmail.com wrote:
 
  Hello will be printed 45 times...
 
  On Wed, Sep 21, 2011 at 7:57 PM, sush57 
 sushaant...@gmail.comwrote:
 
  main()
  {
 int tmp;
 for(i=0;i9;i++)
 {
 tmp=fork();
 if(tmp0)
 break;
 printf(Hello);
 }
  }
 
  what's the output and how does this work
 
  can u give few other questions using fork...
 
  --
  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.
 
  --
  *Anil  Arya,
  Computer Science *
  *Motilal Nehru National Institute of Technology,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.
 
  --
  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

[algogeeks] juniper networks

2011-09-14 Thread ravi maggon
Did juniper visit any campus for training or job recruitment?

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



[algogeeks] find the error

2011-09-14 Thread ravi maggon
Something like this was asked in written test of Tally. We had to find the
cause why this program crased during run time.
File *f;
int count=0;
if(f=fopen(file.txt,r))
{
  while(f.get()!=EOF)
  {
count++;
  }
}

-- 
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] find the error

2011-09-14 Thread ravi maggon
sorry fclose was also written in the last line. I missed it while asking.

On Wed, Sep 14, 2011 at 6:10 PM, abhinav gupta guptaabhinav...@gmail.comwrote:

 file not closed.

 On Wed, Sep 14, 2011 at 5:56 PM, ravi maggon maggonr...@gmail.com wrote:

 Something like this was asked in written test of Tally. We had to find the
 cause why this program crased during run time.
 File *f;
 int count=0;
 if(f=fopen(file.txt,r))
 {
   while(f.get()!=EOF)
   {
 count++;
   }
 }

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




 --
 @ |3  # ! /\/ @ \./

 --
 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
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: informatica pattern and question of interview

2011-09-14 Thread ravi maggon
In Thapar Criteria was
BE CSE and I think MCA was also eligible but for interviews only BE CSE were
shortlisted.
Package: 7.75 lpa

On Wed, Sep 14, 2011 at 6:56 PM, sush57 sushaant...@gmail.com wrote:

 many i know what's the criteria and package for the company...

 regards
 sushaanth
 BE-computer science
 Madras Institute of technology

 On Sep 14, 3:02 pm, Ankit Agarwal ankuagarw...@gmail.com wrote:
  2  question
 
  numbers are (a1+1)*a2*a3... an = a1*a2*a3...an + a2*a3...an
  the first term is same...
  for second term is (a1*a2...an)/(a1)
  now we have to find max of ( ((a1*a2..an)/a1),  (a1*a2...an)/a2)
  so the question of max becomes min of( a1, a2, a3... an)
 
  --
  Ankit Agarwal
  Computer Science  Engg.
  Integrated Dual Degree, V yr
  Department of Electronics  Computer Engineering
  Indian Institute of Technology Roorkee
  Ph. no. +91-9580098805

 --
 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
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: informatica interview question

2011-09-13 Thread ravi maggon
@manoj:
clear your concepts about DS, Algo's and C/C++ because questions are on
basics of these.
their are 25 ques and you get 45 min to solve them. their are some question
on preorder , inorder, etc. some on fork() command.

#one ques was to find the complexity of this code
for(i=0;in;i++)
for(j=0;ji*i;j++)
for(k=0;kj;k++)
sum++;

some ques on comparing BST, hash tables, arrays, sorted arrays and u have to
tell which is better of them

one ques was to show the list after first pass of quick sort if pivot
element is given..
another one was to tell the benefit of using last element as pivot. (its ans
was in the case when list is sorted in reverse order).

some question on graphs like 3 stmts given, u need to tell which is correct,
etc.

all question were juding ur basics.
Do practice well and best of luck.

On Tue, Sep 13, 2011 at 10:25 PM, Manoj Bagari manojbag...@gmail.comwrote:

 ravi can u please tell usa bout the written test what type of question
 asked etc?

 --





 'Life can be filled with disappointment but being happy is a choice'

 Manoj Bagari
 National Institute Technology Kernataka


  --
 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
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: alternative of stack

2011-09-11 Thread ravi maggon
I have emailed lot of questions of informatica on my previous posts. Just
check them.

On Sun, Sep 11, 2011 at 12:01 PM, htross htb...@gmail.com wrote:

 please put some other questions of informatica pleaseit will be
 helpful.

 On Sep 11, 11:25 am, Vijay Khandar vijaykhand...@gmail.com wrote:
  property of stack is last in first out
 
  On Sun, Sep 11, 2011 at 11:52 AM, UTKARSH SRIVASTAV 
 usrivastav...@gmail.com
 
 
 
 
 
 
 
   wrote:
   hi i think we have to maintain the property of stack that is first come
   first out this can be made only when there is linked list maintain
 with
   property of stack and it will grow in run  time
 
   On Sun, Sep 11, 2011 at 11:43 AM, Vijay Khandar 
 vijaykhand...@gmail.comwrote:
 
   Can u explain how? linked list
 
On Sun, Sep 11, 2011 at 11:22 AM, Neha Singh 
 neha.ndelhi.1...@gmail.com
wrote:
 
   Linked List
 
   --
   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.
 
   --
   *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.




-- 
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] what is the output????

2011-09-11 Thread ravi maggon
Hello will be printed 9 times.

On Sun, Sep 11, 2011 at 3:25 AM, htross htb...@gmail.com wrote:

 main()
 {
int tmp;
for(i=0;i9;i++)
{
tmp=fork();
if(tmp0)
break;
printf(Hello);
}
 }

 --
 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
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] pgm2

2011-09-11 Thread ravi maggon
1. Let x be the missing and y be the repeated element
3. Calculate the sum of all the elements and sum of squares of all the
elements of array.

S=Sum of all the elements of array
S1= Sum of squares of all the elements of array

Sum of first n natural numbers=a= ( n * (n+1) )/2
Sum of squares of first n natural no=b= n * (n+1) * (2n+1) / 6

a=S+x-y
b=S1+x^2- y^2

(b-S1)/(a-S)=x+y;
Now we have 2 equations and 2 variables  hence both x and y can be found.

On Sun, Sep 11, 2011 at 3:58 PM, parag khanna khanna.para...@gmail.comwrote:

 Q.) Take an array of 100 elements and fill it with the no 1 to 100 such
 that one no. should skip and one no. should repeated. Find the no. which is
 repeated and which is skipped.






 --
 Parag Khanna
 B.tech Final Year
 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.




-- 
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] pgm2

2011-09-11 Thread ravi maggon
if you have to find only the repeated element, you can use the below
mentioned code.

for (int i = 1; i  N; i++)
{
   array[i] = array[i] ^ array[i-1] ^ i;
}

printf(Answer : %d\n, array[N-1]);

Thinking for the missing no.

On Sun, Sep 11, 2011 at 4:06 PM, ravi maggon maggonr...@gmail.com wrote:

 1. Let x be the missing and y be the repeated element
 3. Calculate the sum of all the elements and sum of squares of all the 
 elements of array.

 S=Sum of all the elements of array
 S1= Sum of squares of all the elements of array

 Sum of first n natural numbers=a= ( n * (n+1) )/2
 Sum of squares of first n natural no=b= n * (n+1) * (2n+1) / 6

 a=S+x-y
 b=S1+x^2- y^2

 (b-S1)/(a-S)=x+y;

 Now we have 2 equations and 2 variables  hence both x and y can be found.

 On Sun, Sep 11, 2011 at 3:58 PM, parag khanna khanna.para...@gmail.com 
 wrote:

 Q.) Take an array of 100 elements and fill it with the no 1 to 100 such that 
 one no. should skip and one no. should repeated. Find the no. which is 
 repeated and which is skipped.






 --
 Parag Khanna
 B.tech Final Year
 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.



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

 www.algorithmguru.com

 Failure is the opportunity to begin again more intelligently




--
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] You have given a number N. You need to find out total number of set bits from 0 to N.

2011-09-11 Thread ravi maggon
I found this algo on
http://stackoverflow.com/questions/109023/best-algorithm-to-count-the-number-of-set-bits-in-a-32-bit-integer

int NumberOfSetBits(int i)
{
   i = i - ((i  1)  0x);
   i = (i  0x) + ((i  2)  0x);
   return ((i + (i  4)  0x0F0F0F0F) * 0x01010101)  24;
}

Can anyone explain this?


On Sun, Sep 11, 2011 at 5:04 PM, Neha Singh neha.ndelhi.1...@gmail.com
wrote:

 --
 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
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] You have given a number N. You need to find out total number of set bits from 0 to N.

2011-09-11 Thread ravi maggon
int bitcount (unsigned int n)  {
  int count = 0 ;
  while (n)  {
 count++ ;
 n = n  (n - 1) ;
  }
  return count ;
}


On Sun, Sep 11, 2011 at 5:08 PM, ravi maggon maggonr...@gmail.com wrote:

 I found this algo on
http://stackoverflow.com/questions/109023/best-algorithm-to-count-the-number-of-set-bits-in-a-32-bit-integer

 int NumberOfSetBits(int i)
 {
i = i - ((i  1)  0x);
i = (i  0x) + ((i  2)  0x);
return ((i + (i  4)  0x0F0F0F0F) * 0x01010101)  24;
 }

 Can anyone explain this?


 On Sun, Sep 11, 2011 at 5:04 PM, Neha Singh neha.ndelhi.1...@gmail.com
wrote:
 
  --
  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
 Ravi Maggon
 B.E. CSE, Final Year
 Thapar University

 www.algorithmguru.com

 Failure is the opportunity to begin again more intelligently





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



[algogeeks] logical and physical address

2011-09-10 Thread ravi maggon
we have page table having 64 entries of 10 bits each. and page size is of
512 bytes.
tell the no of bits required for physical and logical address.

-- 

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

-- 
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] alternative of stack

2011-09-10 Thread ravi maggon
if you don't know the size of stack and it grows during run time then which
data structure will you prefer for stack and why?
1. BST
2. Linked list
3. Arrays
4. Hash Tables

Asked in written test of informatica

-- 

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

-- 
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] informatica interview question

2011-09-09 Thread ravi maggon
1. can recursive func be converted to iterative func always
Yes/No
is vice versa True/False
if False give the example.

2. can recursion be done without stack when converted to iterative sort of
thing or we need to implement our own stack?

-- 

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

-- 
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] virtual table count

2011-09-09 Thread ravi maggon
let their be two classes A and B having a virtual function.
class C derives both class A and B.
How many virtual table does class C have?


-- 

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

-- 
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] worst case complexity

2011-09-09 Thread ravi maggon
What is the complexity of this code

for(i=0;in;i++)
{
for(j=0;ji*i;j++)
{
for(k=0;kj;k++)
}
}

1. O(n^3)
2. O(n^4)
3. O(n^5)
4. O(n^6)
-- 

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

-- 
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] tree traversal

2011-09-09 Thread ravi maggon
give some traversal other then pre,in and post order to print all elements
of tree?
Asked in informatica interview.

-- 

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

-- 
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] semaphores

2011-09-09 Thread ravi maggon
tell the out of the below code related to mutex and semaphore

process1
wait(mutex);
print 0
print 1
signal(mutex);


process2

wait(mutex)
print 1
print 0
signal(mutex)

-- 

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

-- 
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] tree traversal

2011-09-09 Thread ravi maggon
can u elaborate its algo

On Sat, Sep 10, 2011 at 10:58 AM, Shravan Kumar shrava...@gmail.com wrote:

 zigzag, level by level ?

 On Sat, Sep 10, 2011 at 10:48 AM, ravi maggon maggonr...@gmail.comwrote:

 give some traversal other then pre,in and post order to print all elements
 of tree?
 Asked in informatica interview.

 --

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

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




-- 

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

-- 
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] worst case complexity

2011-09-09 Thread ravi maggon
I think it should be n^3

On Sat, Sep 10, 2011 at 10:51 AM, Neha Singh neha.ndelhi.1...@gmail.comwrote:

 O(n^5)

 --
 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
Ravi Maggon
Final Year, B.E. CSE
Thapar University

-- 
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: informatica pattern and question of interview

2011-09-09 Thread ravi maggon
interviewer also made addition to this ques of increment by 1 that you can't
do multiplication.

On Sat, Sep 10, 2011 at 10:08 AM, Neha Singh neha.ndelhi.1...@gmail.comwrote:

 i agree with hashd.

 --
 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
Ravi Maggon
Final Year, B.E. CSE
Thapar University

-- 
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] Barclays Placement Procedure

2011-09-07 Thread ravi maggon
yet to come to our campus. I am also having ELitmus test on 12, can you tell
me about the level of test and few ques if u remember.

On Wed, Sep 7, 2011 at 10:50 PM, vartika aggarwal 
vartika.aggarwa...@gmail.com wrote:

 I want to know about the technical test..


 On Wed, Sep 7, 2011 at 10:49 PM, vartika vartika.aggarwa...@gmail.comwrote:

 Has Barclays or Tally Solutions visited any campus so far?
 If it has, please let me know about the kind of questions that were
 asked in its written test..the test would most probably be conducted
 by Elitmus (we've already had the elitmus aptitude test)

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

 Vartika Aggarwal
 Undergraduate Student
 IT Department
 NSIT, Dwarka

  --
 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
Ravi Maggon
Final Year, B.E. CSE
Thapar University

-- 
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] very urgent .. help

2011-09-04 Thread ravi maggon
is their any negative marking?

On Sun, Sep 4, 2011 at 2:42 PM, Anup Ghatage ghat...@gmail.com wrote:

 What is the purpose of this elitmus test?
 Does scoring good in it qualify you for something?

  --
 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
Ravi Maggon
Final Year, B.E. CSE
Thapar University

-- 
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] which is better Subquery or Join

2011-09-01 Thread ravi maggon
which is better Subquery or Join in sql and why?

-- 

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

-- 
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] which is better Subquery or Join

2011-09-01 Thread ravi maggon
for what reason?

On Thu, Sep 1, 2011 at 5:44 PM, sukran dhawan sukrandha...@gmail.comwrote:

 subquery

 On Thu, Sep 1, 2011 at 5:25 PM, ravi maggon maggonr...@gmail.com wrote:

 which is better Subquery or Join in sql and why?

 --

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

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




-- 

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

-- 
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] american express query??

2011-08-31 Thread ravi maggon
can any one tell me about the pattern of american express and the topics it
focus upon in written test and interview.
reply asap.

-- 

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

-- 
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: Static variable

2011-08-31 Thread ravi maggon
Ans would be 00, keep in mind that i is static variable.

On Wed, Aug 31, 2011 at 6:59 PM, rohit raman.u...@gmail.com wrote:

 123456789

 --
 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/-/OsL6-Vp91qoJ.
 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
Final Year, B.E. CSE
Thapar University

-- 
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] memory allocation

2011-08-31 Thread ravi maggon
What memory is allocated to a function, to a variable, to a object created
at run time using new or malloc and to a function containing a object with
run time memory allocation.

-- 

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

-- 
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: Static variable

2011-08-31 Thread ravi maggon
but why the output coming in both of these codes is different?

On Wed, Aug 31, 2011 at 8:10 PM, rahul sharma rahul23111...@gmail.comwrote:

 these two are same

 On Aug 31, 7:36 pm, ravi maggon maggonr...@gmail.com wrote:
  I check out the code:
 
  #includestdio.h
  main()
  {
  static int i=10;
  while(i0)
  {
  --i;
  main();
  printf(%d,i);
  }
 
  }
 
  if you run this you get 00 as output
 
  but if you run this
 
  #includestdio.h
  main()
  {
  static int i=10;
  while(i0)
  {
  --i;
  main();
  printf(%d,i);
  }
 
  }
 
  You get 0-1-2-3-4-5-6-7-8 as output.
 
  Whats the difference in these?
 
  On Wed, Aug 31, 2011 at 7:52 PM, aditi garg aditi.garg.6...@gmail.com
 wrote:
 
 
 
 
 
 
 
 
 
   @abhishek: y till -8?
 
   On Wed, Aug 31, 2011 at 7:50 PM, vishal jain vishal.l...@gmail.com
 wrote:
 
   I executed on linux machine..
 
   I am gettign output
 
   0-1-2-3-4-5-6-7-8 :(
 
   for code
   int main()
 
   {
   static int i=10;
   while(--i0)
   {
main();
printf(%d,i);
   }
   return 0;
   }
 
   On Wed, Aug 31, 2011 at 7:48 PM, Abhishek Mallick 
   abhishek.mallick2...@gmail.com wrote:
 
   The recursion will run 10 times printing nothing. Then ones it
 returns
   on the 10th one. It will start printing from 0 to -8 (As i is
 static).
 
   On Aug 31, 6:33 pm, ravi maggon maggonr...@gmail.com wrote:
Ans would be 00, keep in mind that i is static variable.
 
 On Wed, Aug 31, 2011 at 6:59 PM, rohit raman.u...@gmail.com
 wrote:
 123456789
 
 --
 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/-/OsL6-Vp91qoJ.
 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
Final Year, B.E. CSE
Thapar University
 
   --
   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.
 
   --
   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.
 
  --
 
  Regards
  Ravi Maggon
  Final Year, B.E. CSE
  Thapar University

 --
 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
Ravi Maggon
Final Year, B.E. CSE
Thapar University

-- 
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] fork()

2011-08-31 Thread ravi maggon
Can anyone tell me about this code

#include stdio.h
#include unistd.h
int main()
{
   fork();
   fork()  fork() || fork();
   fork();
   printf(forked\n);
   return 0;
}

The no. of processes spawned and its logic.


-- 

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

-- 
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: Winshuttle Interview Questions

2011-08-30 Thread ravi maggon
@birju:
I am elaborating 2nd ques below:
let us suppose their is 2-d array say A[100][2];
here 100 signifies that their are 100 coordinates given and 2 signify that
you have x and y in A[][0] and A[][1] respectively.
When you join the points in some order they form a closed loop of any shape
in a given plane.
You need to tell the max diameter of circle which can be placed in that fig
formed by joining above coordinates.

On Tue, Aug 30, 2011 at 12:15 AM, Brijesh brijeshupadhyay...@gmail.comwrote:

 Yaar second question thoda elaborate kar.. didn't get it !

 --
 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/-/3ClTQN8-GBEJ.

 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

-- 
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: Winshuttle Interview Questions

2011-08-30 Thread ravi maggon
One more ques asked was:
output of printf(%x,-l4);
where l can be any positive number.

On Tue, Aug 30, 2011 at 1:11 PM, ravi maggon maggonr...@gmail.com wrote:

 @birju:
 I am elaborating 2nd ques below:
 let us suppose their is 2-d array say A[100][2];
 here 100 signifies that their are 100 coordinates given and 2 signify that
 you have x and y in A[][0] and A[][1] respectively.
 When you join the points in some order they form a closed loop of any shape
 in a given plane.
 You need to tell the max diameter of circle which can be placed in that fig
 formed by joining above coordinates.


 On Tue, Aug 30, 2011 at 12:15 AM, Brijesh brijeshupadhyay...@gmail.comwrote:

 Yaar second question thoda elaborate kar.. didn't get it !

 --
 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/-/3ClTQN8-GBEJ.

 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




-- 

Regards
Ravi Maggon

-- 
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] The Smart Cube Query

2011-08-30 Thread ravi maggon
Can anyone give me reviews about The Smart Cube company and its placement
procedure.
What kind of work it has and is it better then Core IT companies for CSE
student
reply asap.

-- 

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

-- 
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] Class Doubt

2011-08-28 Thread ravi maggon
Hi
Can you explain the below mentioned code. As far as I know we need to
overload = operator in order to equate object of a class and below code
should give error. But it is running perfectly on gcc compiler. Please
correct  me if I am wrong at some point.

#includeiostream
using namespace std;

class emp
{
  public:
 char *n;
 int age;
};
int main ()
{
emp e={xyz,21};
emp e2;
e2=e;
printf(%d,e2.age);
system(pause);
}


-- 

Regards
Ravi Maggon

-- 
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] c doubt

2011-08-28 Thread ravi maggon
class{
 int bit1:1;
}

please explain the meaning of line 2.

-- 

Regards
Ravi Maggon

-- 
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: Class Doubt

2011-08-28 Thread ravi maggon
@all: thanks

On Sun, Aug 28, 2011 at 4:55 PM, rahul vatsa vatsa.ra...@gmail.com wrote:

 c++ provides a few default member functions for your class if you don't
 declare them urself, this includes copy constructor  assignment(=)
 operator.

 In your program,
  emp e={xyz,21}; // the default copy constructor is invoked
 e2=e; // here the default assignment operator is invoked



 On Sun, Aug 28, 2011 at 7:14 AM, prateek gupta 
 prateek21590gu...@gmail.com wrote:

 In c++ we have default copy constructor ,which is called when we use
 statement like e2=e;ie when object are of same class type.

 On Aug 28, 3:29 pm, ravi maggon maggonr...@gmail.com wrote:
  Hi
  Can you explain the below mentioned code. As far as I know we need to
  overload = operator in order to equate object of a class and below code
  should give error. But it is running perfectly on gcc compiler. Please
  correct  me if I am wrong at some point.
 
  #includeiostream
  using namespace std;
 
  class emp
  {
public:
   char *n;
   int age;};
 
  int main ()
  {
  emp e={xyz,21};
  emp e2;
  e2=e;
  printf(%d,e2.age);
  system(pause);
 
  }
 
  --
 
  Regards
  Ravi Maggon

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




-- 

Regards
Ravi Maggon

-- 
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] SQL Question

2011-08-28 Thread ravi maggon
SELECT DISTINCT(NAME) FROM TABLE1;

write a query to produce same result as that of above one but without using
DISTINCT.
Is this thing possible?

-- 

Regards
Ravi Maggon

-- 
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] Algorithms for Interviews _scan ocr_.pdf

2011-08-13 Thread Ravi Maggon
Hi
Just visit this link and download the same

https://docs.google.com/viewer?a=vpid=explorerchrome=truesrcid=1H2e-TjPH2Vmz7zjUQGD2XIhIwMjGuZERr2EIIPrOjLHENF28MlxDABrfQP7bhl=en_US

Regards
Ravi Maggon



On Aug 13, 2011, at 11:45 PM, A for ♥ღAakasHღ♥ wrote:

 
 
 On Sat, Aug 13, 2011 at 11:39 PM, *$* gopi.komand...@gmail.com wrote:
 Hi,
  the link is not working at my end.. could you plz repost the same
 
 
 Just have patience...it is taking time 
 After all itz 15.5MB.:) 
 
 -- 
 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] Fwd: Fw: Building a Binary tree with XOR

2011-04-21 Thread ravi maggon
Plz help out the with the below mentioned problem (Query by Someone else, i
was not able to understand)

Building a Binary tree with XOR

Hi All,

Before starting any binary tree problem I will be creating such kind
of binary tree and will be solving that problem accordingly.

From the last few days I am trying to code to build a binary tree with
Exclusive Operators. Here I am trying to build the tree in the level
order way like all the elements will be placed in the queue in the
order of levels so that the final binary tree will be almost complete
binary tree.

In general the left node will contain the left side tree adress
details and right node will contain the right tree details.
But the XOR Binary trees will be holding the XOR values of parent and
left child in the left node and in the same way the parent and right
child will be in the right part.

Here I am unable to track the parent of a particular node after the
level 3. Does it possible to create a XOR binary tree with the level
order mechanism. If possible, could you provide me clues in resolving
this problem.

My files looks like as below

Header file:

#includeiostream
#includequeue
using namespace std;
typedef unsigned long pointer;

struct BTXNode
{
int data;
struct BTXNode* fleft;
struct BTXNode* fright;
};

class BTX
{

struct BTXNode *root;

public:
BTX()
{
root=NULL;
}
struct BTXNode* getNode(int data);
int insertAtLeaf(struct BTXNode* node);

};
--

CPP file
---
#include btf_xor.h

struct BTXNode* BTX::getNode(int data)
{
struct BTXNode* node=new BTXNode();

node-data=data;
node-fleft=NULL;
node-fright=NULL;

return node;
}

int BTX::insertAtLeaf(struct BTXNode* nd)
{
coutinsertAtLeaf Data is nd-dataendl;
bool set_ind=true;
bool  right_ind=false;
struct BTXNode *parent=NULL;
if(!root)
{
root=nd;
return 1;
}
queueBTXNode* q;
q.push(root);
q.push(NULL);

while(!q.empty()  set_ind)
{

struct BTXNode *temp=q.front();
q.pop();

if(temp)
{
couttemp-data istemp-dataendl;
if(temp-fleft != parent)
{
struct BTXNode* left=(struct BTXNode*)((pointer)temp-
fleft^(pointer)parent);
q.push(left);
right_ind=true;
}
else
{
nd-fleft=(struct BTXNode*)((pointer)temp ^
(pointer)nd-fleft);
nd-fright=(struct BTXNode*)((pointer)temp ^
(pointer)nd-fright);
//temp-fleft=(struct BTXNode*)((pointer)nd ^
(pointer)parent);
temp-fleft=(struct BTXNode*)((pointer)nd ^
(pointer)temp-fleft);
right_ind=false;
set_ind=false;

}
if(right_ind)
{
if(temp-fright != parent)
{
struct BTXNode* right=(struct BTXNode*)((pointer)temp-
fright^(pointer)parent);
q.push(right);
right_ind=true;
}
else
{
  nd-fright=(struct BTXNode*)((pointer)temp ^
(pointer)nd-fright);
  nd-fleft=(struct BTXNode*)((pointer)temp ^
(pointer)nd-
fleft);
  //temp-fright=(struct BTXNode*)((pointer)nd ^
(pointer)parent);
  temp-fright=(struct BTXNode*)((pointer)nd ^
(pointer)temp-
fright);
  set_ind=false;
}
}
parent=temp;
}
else
{
if(!q.empty())
{
q.push(NULL);
}

}
}
}





int main()
{
BTX btx;
btx.insertAtLeaf(btx.getNode(10) );
btx.insertAtLeaf(btx.getNode(8));
btx.insertAtLeaf(btx.getNode(12));
btx.insertAtLeaf(btx.getNode(7));
btx.insertAtLeaf(btx.getNode(9));
btx.insertAtLeaf(btx.getNode(11));
btx.insertAtLeaf(btx.getNode(13));

return 0;

}






Regards
Sunil





-- 

Regards
Ravi Maggon

-- 
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] Stuck at UVa Online judge problem no. 825 (Walking on Safe Side)

2011-03-30 Thread ravi maggon
Hey,
I am getting WA for the problem Walking on Safe side for my code written
below. I have checked all test cases and formatting of output and its
working fine on my pc, could anyone help plz.

Here is the problem link

http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8page=show_problemcategory=10problem=766mosmsg=Submission+received+with+ID+8692538



Here is my code

#includeiostream
#includecstdio
#includecstring
#includecstdlib
using namespace std;
int table[200][200]={};
char str[200];
int dx,dy;
int ans=0;
void cal(int x,int y)
{
if(x==dxy==dy)
{
ans++;
return;
}
if(table[x][y+1]==0ydy)
{

cal(x,y+1);
}
if(table[x+1][y]==0xdx)
{

cal(x+1,y);
}
}
void Reset() {
int i, j;
for(i = 0; i=dx; i++)
{
for(j = 0; j=dy; j++)
{
table[i][j] = 0;
}
}
}

void ReadCase() {
int i, j;
char *p;
gets(str);
cindxdy;
Reset();
for(i = 0; i=dx; i++) {
gets(str);
p = strtok(str, );
p = strtok(NULL,  );
while(p) {
j = atoi(p);
table[i-1][j-1] = 1;
p = strtok(NULL,  );
}
}
dx--;
dy--;
/*for(i=0;i=dx;i++)
{
for(j=0;j=dy;j++)
{
couttable[i][j] ;
}
cout\n;
}*/
}
int main()
{
int t;
cint;
while(t--)
{
ans=0;
ReadCase();
cal(0,0);
coutans;
if(t!=0)
cout\n\n\n;
}
}


-- 

Regards
Ravi Maggon

-- 
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] Re: AlgorithmGuru Monthly Challenge

2011-03-26 Thread ravi maggon
Hey,
All constraints have been added or replied in comments by the admin.

On Sat, Mar 26, 2011 at 2:24 PM, utkarsh lath utkarsh.l...@gmail.comwrote:

 You guys do not provide limits for the problems ?
 Is it that you just want a correct algorithm, however bad it runs in
 practice ?


 On Sat, Mar 26, 2011 at 1:05 PM, ravi maggon maggonr...@gmail.com wrote:

 my mistake sorry for that.will take care next time
 Thanks anyways


 On Sat, Mar 26, 2011 at 1:03 PM, utkarsh lath utkarsh.l...@gmail.comwrote:

 Actually, you should bcc your mail to everyone. You do not want spammers
 to get IDs of your poor contestants Do you?

 On Sat, Mar 26, 2011 at 12:48 PM, ravi maggon maggonr...@gmail.comwrote:

 Hello All,
 AlgorithmGuru.com proudly announces the start of its monthly challenge
 of Algorithms and Data Structures related problems.
 *Prize: $50*
 *Visit:
 http://algorithmguru.com/content/index.php?viewpage=./contentfiles/challenge.php
 *
 Show your skills and what you can do to win this contest.

 Hoping for a great response from your side.

 --

 Regards
 Team, AlgorithmGuru
 www.algorithmguru.com





 --

 Regards
 Ravi Maggon





-- 

Regards
Ravi Maggon

-- 
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] Re: AlgorithmGuru Monthly Challenge

2011-03-26 Thread ravi maggon
Hey,
You need to login first on the site to see the problems
This is the main link of the contest page
http://algorithmguru.com/content/index.php?viewpage=./contentfiles/challenge.php
If still you are not able to find the problem, just email me i ll ask the
admin of the contest to check or mail you the problem.

On Sat, Mar 26, 2011 at 4:53 PM, saurabh singh saurab...@gmail.com wrote:

 I cant find the problems???:(

 --
 Saurabh Singh
 B.Tech (Computer Science)
 MNNIT ALLAHABAD





-- 

Regards
Ravi Maggon

-- 
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] Algorithm Monthly Contest (Prize $50)

2011-03-25 Thread ravi maggon
Hey,
Monthly challenge of http://algorithmguru.com has started.participate to
excel your skills in algorithms and win prizes worth $50.

-- 

Regards
Ravi Maggon

-- 
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] Interesting Website with all the content (www.algorithmguru.com)

2011-03-22 Thread ravi maggon
Hey all,
Do visit this website http://algorithmguru.com/content/index.php with many
interesting features including algorithm rich repository, more than 300 ques
of quiz and most interesting part its monthly and annual challenge with
attractive prizes to be won. Do visit this site.

-- 

Regards
Ravi Maggon
Thapar University

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