Re: [algogeeks] Re: Element in Array Repeated Even Number of Times

2011-09-09 Thread Pritpal Singh
@Dave : Please specify reason for choosing radix sort ?

On Thu, Sep 8, 2011 at 7:02 AM, Sandy sandy.wad...@gmail.com wrote:

 Thanks Dave, Piyush, and Bittursk.


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

 @Sandy: It can be done in O(n) time with O(n) extra space by sorting
 the data with a radix sort and then scanning the array for the element
 you are seeking.

 Dave

 On Sep 7, 11:43 am, Sandy sandy.wad...@gmail.com wrote:
  You have an array in which every number is repeated odd number of times
  except one.  Write a function to find that one element in O(n) time.
 
  --
 
  *Sandeep Kumar,*
   ( Mobile +91-9866507368
 
  *“I believe in smart work, Believe Me”*

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




 --

 *Sandeep Kumar,*
  ( Mobile +91-9866507368

 *“I believe in smart work, Believe Me”*


  --
 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] Find the error..

2011-06-22 Thread PRITPAL SINGH
What do you expect it to give ?


On Wed, Jun 22, 2011 at 4:25 PM, Balaji S balaji.ceg...@gmail.com wrote:

 What is the wrong in this program
 main()
 {
 char *p,*q;
 p=(char *)malloc(25);
 q=(char*) malloc(25);
 strcpy(p,INDIA );
 strcpy(q,hyd);
 strcat(p,q);
 printf(%s,p);
 }

 --
 With Regards,
 Balaji.S

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
Regards
Pritpal Singh Banga
(RIT2008021)
BTech ( IT ) , 6th Semester,
Indian Institute of Information Technology
Allahabad - 211012, India
Official email : rit2008...@iiita.ac.in rit2008...@iiita.ac.in
Mobile: +91-9793907703

-- 
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-06-22 Thread PRITPAL SINGH
http://www.ideone.com/pubwV

On Wed, Jun 22, 2011 at 4:30 PM, PRITPAL SINGH pritpal2...@gmail.comwrote:

 What do you expect it to give ?



 On Wed, Jun 22, 2011 at 4:25 PM, Balaji S balaji.ceg...@gmail.com wrote:

 What is the wrong in this program
 main()
 {
 char *p,*q;
 p=(char *)malloc(25);
 q=(char*) malloc(25);
 strcpy(p,INDIA );
 strcpy(q,hyd);
 strcat(p,q);
 printf(%s,p);
 }

 --
 With Regards,
 Balaji.S

  --
 You received this message because you are subscribed to the Google Groups
 Algorithm Geeks group.
 To post to this group, send email to algogeeks@googlegroups.com.
 To unsubscribe from this group, send email to
 algogeeks+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




 --
 Regards
 Pritpal Singh Banga
 (RIT2008021)
 BTech ( IT ) , 6th Semester,
 Indian Institute of Information Technology
 Allahabad - 211012, India
 Official email : rit2008...@iiita.ac.in rit2008...@iiita.ac.in
 Mobile: +91-9793907703




-- 
Regards
Pritpal Singh Banga
(RIT2008021)
BTech ( IT ) , 6th Semester,
Indian Institute of Information Technology
Allahabad - 211012, India
Official email : rit2008...@iiita.ac.in rit2008...@iiita.ac.in
Mobile: +91-9793907703

-- 
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-06-22 Thread PRITPAL SINGH
@balaji

I think memory leak is the only problem with the code.
rest is fine

On Wed, Jun 22, 2011 at 6:03 PM, Balaji S balaji.ceg...@gmail.com wrote:

 @pritpal : Refer ques 5 at
 http://www.youthrocker.com/2011/06/interview-questions-amazon-placement.html

 @shachindra : wats tat :-o

 --
 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
Pritpal Singh Banga
(RIT2008021)
BTech ( IT ) , 6th Semester,
Indian Institute of Information Technology
Allahabad - 211012, India
Official email : rit2008...@iiita.ac.in rit2008...@iiita.ac.in
Mobile: +91-9793907703

-- 
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] MS question

2011-06-02 Thread PRITPAL SINGH
Ya!Hello! how is this? %s\n
is essentially a character array
3[Ya!Hello! how is this? %s\n] yields H.
3[Ya!Hello! how is this? %s\n] yields address of character array
beginning with H i.e address of array Hello! how is this? %s\n which forms
the format string in printf.

Thus Hello! how is this gets printed and then printf looks for a string in
its arguments.
b[junk/super] yields super...which gets printed due to %s in format
string.

Similar arguments apply to second case



On Thu, Jun 2, 2011 at 11:45 PM, shashankreddy509 
shashankreddy...@gmail.com wrote:

 Can any one explain the output of this...

 i have a guess.

 int a=3, b = 5;printf(a[Ya!Hello! how is this? %s\n],
 b[junk/super]);

 here a is 3 so it print the after 3 characters  ie.*Hello! how is this?*
 .
 and coming to b is 5 so it prints *super*.

 this is my guess and i cant get the other part this.

 so can any one tell the correct answer..

 thanks.

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

 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
Pritpal Singh Banga
(RIT2008021)
BTech ( IT ) , 6th Semester,
Indian Institute of Information Technology
Allahabad - 211012, India
Official email : rit2008...@iiita.ac.in rit2008...@iiita.ac.in
Mobile: +91-9793907703

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