Re: [algogeeks] Question
you might get error: floating pointing formats not linked!! but thats obsolete! I don't compiler these days will give such an error otherwise code written by Dipankar will solve ur problem if u r unable to take multi-word input On Fri, Aug 5, 2011 at 7:24 PM, Dipankar Patro dip10c...@gmail.com wrote: try doing this way and tell if the program is working properly now: for (i=0; i3; i++) { scanf(%[^\n], e[i].name); scanf(%f, e[i].sal); } There is always some problem in string input using %s, don't really know why though deeply. On 5 August 2011 17:48, Vijay Khandar vijaykhand...@gmail.com wrote: But program is not working properly... On Fri, Aug 5, 2011 at 5:44 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: Couldn't find any error. On Fri, Aug 5, 2011 at 5:38 PM, Vijay Khandar vijaykhand...@gmail.comwrote: What errors are you likely to get when you run the following program? #includestdio.h #includeconio.h #includestring.h void main() { clrscr(); struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for(i=0;i=3;i++) scanf(%s %f,e[i].name,e[i].sal); getch(); } Plz Explain anyone. Vijay.. -- 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. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- 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] Question
which compiler are u using ? On Fri, Aug 5, 2011 at 7:29 PM, Vijay Khandar vijaykhand...@gmail.comwrote: I include this fn linkfloat(), Now my program working properlybut why we have to include this fn externally plz explain. On Fri, Aug 5, 2011 at 6:07 PM, SANDEEP CHUGH sandeep.aa...@gmail.comwrote: INCLUDE THIS FUNCTION linkfloat( ) { float a = , *b ; b = a ; /* cause emulator to be linked */ a = *b ;/* suppress the warning - variable not used */ }; On Fri, Aug 5, 2011 at 6:04 PM, Vijay Khandar vijaykhand...@gmail.comwrote: But program is not giving the o/p. I have taken one printf statement same as scanf..and scanf() taking i/p but prinf() not giving o/p... On Fri, Aug 5, 2011 at 5:53 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: http://www.ideone.com/ZIibX The changes I have done in the program are to make it compatible to gcc compiler. Check the statement in the bottom of the page. On Fri, Aug 5, 2011 at 5:46 PM, Vijay Khandar vijaykhand...@gmail.comwrote: What errors are you likely to get when you run the following program? #includestdio.h #includeconio.h #includestring.h void main() { clrscr(); struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for(i=0;i=3;i++) scanf(%s %f,e[i].name,e[i].sal); getch(); } A)floating point format not linked B)Suspicious pointer conversion C)Cannot use scanf() for structures D)Strings cannot be nested inside structures Plz Explain anyone. Vijay. -- 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. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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] simple doubt
I dont think so dp=arr; since **dp; dp contains the addr of another ptr variable... On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote: I guess someone had posted a link earlier from which I have a basic doubt when u have int arr[3]={1,0,2}; int **dp; int (*pa)[3]; is this the right assingment for instance? pa=arr; dp=arr; or have I flipped the ampersand in assigning? Also when I do pa++ will it jump by size of int or the whole array size it points to? -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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] Question
Yes correct, In m using very old compiler Turbo C++ On Fri, Aug 5, 2011 at 7:34 PM, Rohit Srivastava access2ro...@gmail.comwrote: you might get error: floating pointing formats not linked!! but thats obsolete! I don't compiler these days will give such an error otherwise code written by Dipankar will solve ur problem if u r unable to take multi-word input On Fri, Aug 5, 2011 at 7:24 PM, Dipankar Patro dip10c...@gmail.comwrote: try doing this way and tell if the program is working properly now: for (i=0; i3; i++) { scanf(%[^\n], e[i].name); scanf(%f, e[i].sal); } There is always some problem in string input using %s, don't really know why though deeply. On 5 August 2011 17:48, Vijay Khandar vijaykhand...@gmail.com wrote: But program is not working properly... On Fri, Aug 5, 2011 at 5:44 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: Couldn't find any error. On Fri, Aug 5, 2011 at 5:38 PM, Vijay Khandar vijaykhand...@gmail.comwrote: What errors are you likely to get when you run the following program? #includestdio.h #includeconio.h #includestring.h void main() { clrscr(); struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for(i=0;i=3;i++) scanf(%s %f,e[i].name,e[i].sal); getch(); } Plz Explain anyone. Vijay.. -- 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. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Question
try using dev or any new 32bit compiler it wont give that error!!! or try using this void linkfloat(void) { float a=0,*b=a; a=*b; } this code forces the emulator to be linked On Fri, Aug 5, 2011 at 7:38 PM, Vijay Khandar vijaykhand...@gmail.comwrote: Yes correct, In m using very old compiler Turbo C++ On Fri, Aug 5, 2011 at 7:34 PM, Rohit Srivastava access2ro...@gmail.comwrote: you might get error: floating pointing formats not linked!! but thats obsolete! I don't compiler these days will give such an error otherwise code written by Dipankar will solve ur problem if u r unable to take multi-word input On Fri, Aug 5, 2011 at 7:24 PM, Dipankar Patro dip10c...@gmail.comwrote: try doing this way and tell if the program is working properly now: for (i=0; i3; i++) { scanf(%[^\n], e[i].name); scanf(%f, e[i].sal); } There is always some problem in string input using %s, don't really know why though deeply. On 5 August 2011 17:48, Vijay Khandar vijaykhand...@gmail.com wrote: But program is not working properly... On Fri, Aug 5, 2011 at 5:44 PM, Nikhil Gupta nikhilgupta2...@gmail.com wrote: Couldn't find any error. On Fri, Aug 5, 2011 at 5:38 PM, Vijay Khandar vijaykhand...@gmail.com wrote: What errors are you likely to get when you run the following program? #includestdio.h #includeconio.h #includestring.h void main() { clrscr(); struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for(i=0;i=3;i++) scanf(%s %f,e[i].name,e[i].sal); getch(); } Plz Explain anyone. Vijay.. -- 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. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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] simple doubt
i see but is not arr a pointer to first array element and so arr contain address of that pointer ? On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar vijaykhand...@gmail.comwrote: I dont think so dp=arr; since **dp; dp contains the addr of another ptr variable... On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan aaron.nar...@gmail.com wrote: I guess someone had posted a link earlier from which I have a basic doubt when u have int arr[3]={1,0,2}; int **dp; int (*pa)[3]; is this the right assingment for instance? pa=arr; dp=arr; or have I flipped the ampersand in assigning? Also when I do pa++ will it jump by size of int or the whole array size it points to? -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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] Question
Yes due to this only i m getting proper o/p, but why it is necessary in Turbo C++ compiler.? On Fri, Aug 5, 2011 at 7:41 PM, Rohit Srivastava access2ro...@gmail.comwrote: try using dev or any new 32bit compiler it wont give that error!!! or try using this void linkfloat(void) { float a=0,*b=a; a=*b; } this code forces the emulator to be linked On Fri, Aug 5, 2011 at 7:38 PM, Vijay Khandar vijaykhand...@gmail.comwrote: Yes correct, In m using very old compiler Turbo C++ On Fri, Aug 5, 2011 at 7:34 PM, Rohit Srivastava access2ro...@gmail.comwrote: you might get error: floating pointing formats not linked!! but thats obsolete! I don't compiler these days will give such an error otherwise code written by Dipankar will solve ur problem if u r unable to take multi-word input On Fri, Aug 5, 2011 at 7:24 PM, Dipankar Patro dip10c...@gmail.comwrote: try doing this way and tell if the program is working properly now: for (i=0; i3; i++) { scanf(%[^\n], e[i].name); scanf(%f, e[i].sal); } There is always some problem in string input using %s, don't really know why though deeply. On 5 August 2011 17:48, Vijay Khandar vijaykhand...@gmail.com wrote: But program is not working properly... On Fri, Aug 5, 2011 at 5:44 PM, Nikhil Gupta nikhilgupta2...@gmail.com wrote: Couldn't find any error. On Fri, Aug 5, 2011 at 5:38 PM, Vijay Khandar vijaykhand...@gmail.com wrote: What errors are you likely to get when you run the following program? #includestdio.h #includeconio.h #includestring.h void main() { clrscr(); struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for(i=0;i=3;i++) scanf(%s %f,e[i].name,e[i].sal); getch(); } Plz Explain anyone. Vijay.. -- 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. -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- 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] simple doubt
but u initialized **dp means . ex-dp=p and p=arr then its correct so dp contains addr of p which inturns contains addrof arr now **dp is correct initialization. On Fri, Aug 5, 2011 at 7:45 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote: i see but is not arr a pointer to first array element and so arr contain address of that pointer ? On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar vijaykhand...@gmail.comwrote: I dont think so dp=arr; since **dp; dp contains the addr of another ptr variable... On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan aaron.nar...@gmail.com wrote: I guess someone had posted a link earlier from which I have a basic doubt when u have int arr[3]={1,0,2}; int **dp; int (*pa)[3]; is this the right assingment for instance? pa=arr; dp=arr; or have I flipped the ampersand in assigning? Also when I do pa++ will it jump by size of int or the whole array size it points to? -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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] Re: Puzzle
I didn't understand it fully plese explain On Aug 4, 2:48 pm, sagar pareek sagarpar...@gmail.com wrote: double 87.5 gives you 175 100 will be used by 1st well and 75 will be used by second now second well will double the 75 and will give you 150 100 will be used by second and remainder 50 will forwarded to third now third one use 50 and will double it to 100 no remainder left i think its clear now :) :) On Fri, Aug 5, 2011 at 12:14 AM, Himanshu Srivastava himanshusri...@gmail.com wrote: i mean @sagar:how did you get 87.5%?? On Fri, Aug 5, 2011 at 12:13 AM, Himanshu Srivastava himanshusri...@gmail.com wrote: @nikhil:how did you get 87.5%?? On Thu, Aug 4, 2011 at 11:59 PM, sagar pareek sagarpar...@gmail.comwrote: 87.5 % On Thu, Aug 4, 2011 at 10:39 PM, Nikhil Gupta nikhilgupta2...@gmail.com wrote: There are 3 magical wells. Any input quantity of water we provide the 1st well is returned double (of this double, half is kept inside the well, and the other half is used as input to the 2nd well). The 2nd well also returns double the quantity of its input (of which half is kept inside the well, and the other half is used as input to the 3rd well). Same goes with the 3rd, but its half output is the remainder (other half being kept inside the well). Now what input should we provide in the 1st well, so that the remainder at the end comes out to be zero? (Asked in classroom coaching of T.I.M.E.) -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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 SAGAR PAREEK 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. -- 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 SAGAR PAREEK 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.
[algogeeks] PTR Q
Pointers provide a convenient way to represent multidimensional arrays, allowing a single array multidimensional array to be replaced by a lower-dimensional array of pointers. this statement is true or false... Plz Explain -- 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
Yeah Kadanes algorithm. It can be done in O(n); *Muthuraj R IV th Year , ISE PESIT , Bangalore* On Fri, Aug 5, 2011 at 6:49 PM, Naren s sweetna...@gmail.com wrote: http://people.csail.mit.edu/bdean/6.046/dp/ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Puzzle
of this double, half is kept inside the well, and the other half is used as input to the 2nd well half mean 1/2 or 50% how can we assume it to be 100??? if we take it to be 1/2, the question goes wrong, so ur concept is valid but then question should have been framed correctly On Fri, Aug 5, 2011 at 7:55 PM, Lakshmi Prasad prasadlakshmi...@gmail.comwrote: I didn't understand it fully plese explain On Aug 4, 2:48 pm, sagar pareek sagarpar...@gmail.com wrote: double 87.5 gives you 175 100 will be used by 1st well and 75 will be used by second now second well will double the 75 and will give you 150 100 will be used by second and remainder 50 will forwarded to third now third one use 50 and will double it to 100 no remainder left i think its clear now :) :) On Fri, Aug 5, 2011 at 12:14 AM, Himanshu Srivastava himanshusri...@gmail.com wrote: i mean @sagar:how did you get 87.5%?? On Fri, Aug 5, 2011 at 12:13 AM, Himanshu Srivastava himanshusri...@gmail.com wrote: @nikhil:how did you get 87.5%?? On Thu, Aug 4, 2011 at 11:59 PM, sagar pareek sagarpar...@gmail.com wrote: 87.5 % On Thu, Aug 4, 2011 at 10:39 PM, Nikhil Gupta nikhilgupta2...@gmail.com wrote: There are 3 magical wells. Any input quantity of water we provide the 1st well is returned double (of this double, half is kept inside the well, and the other half is used as input to the 2nd well). The 2nd well also returns double the quantity of its input (of which half is kept inside the well, and the other half is used as input to the 3rd well). Same goes with the 3rd, but its half output is the remainder (other half being kept inside the well). Now what input should we provide in the 1st well, so that the remainder at the end comes out to be zero? (Asked in classroom coaching of T.I.M.E.) -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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 SAGAR PAREEK 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. -- 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 SAGAR PAREEK 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. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.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.
[algogeeks] output???
program output comes - hi why?? #includestdio.h main() { float a=0.7; if(.7 a) printf(hi\n); else printf(hello\n); } -- Regards Rajesh Kumar -- 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] Duplicates in a string
Remove duplicate alphabets from a string and compress it in the same string. For example, MISSISSIPPI becomes MISP. O (n2) is not acceptable. For this problem is it a good idea to sort the array using a sorting technique with efficiency O(nlogn) and remove the duplicates? -- 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] output???
the output will be hi even if u have putted equal to sign there this is becoz 0.7 do not exactly stored like 0.7 in a but some thing lesser as describe in ASCII format that's why it is awlays lesser than 0.7 -- 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] MICRSOFT WRITEN TEST
they always repeat questions. go through lined list and trees questions on geeksforgeeks like finding loop in LL, path in a binary tree (not BST) for a given sum, addition of numbers stored digitwise in a linked list. Printing 2d matrix in spiral order, KMP algorithm - these are some questions they asked in interviews. this one was asked to several candidates: given: ddbbccae output: 2d4a2b2c1a1e isn't that easy? On Fri, Aug 5, 2011 at 11:03 AM, siddharam suresh siddharam@gmail.comwrote: thank you Thank you, Siddharam On Fri, Aug 5, 2011 at 10:51 AM, Poised~ dip10c...@gmail.com wrote: try this: https://groups.google.com/forum/?hl=en#!topic/algogeeks/Mbah1QXrJB4 -- 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/-/pB2VUcnr9igJ. 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. -- Tushar Bindal Computer Engineering Delhi College of Engineering Mob: +919818442705 E-Mail : tushicom...@gmail.com Website: www.jugadengg.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] output???
.7 in float is taken like .699 i blv ? On Fri, Aug 5, 2011 at 8:20 PM, kartik sachan kartik.sac...@gmail.comwrote: the output will be hi even if u have putted equal to sign there this is becoz 0.7 do not exactly stored like 0.7 in a but some thing lesser as describe in ASCII format that's why it is awlays lesser than 0.7 -- 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 and Regards *Karan Bagaria* *MCA Final Year* Training and Placement Representative *NIT Durgapur* -- 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] Duplicates in a string
Store the frequency of all the letters in an array in one scan(like counting sort). In the next pass remove the duplicates and appropriately shift . takes 2 O(n) passes i guess On Fri, Aug 5, 2011 at 4:50 PM, priya v pria@gmail.com wrote: Remove duplicate alphabets from a string and compress it in the same string. For example, MISSISSIPPI becomes MISP. O (n2) is not acceptable. For this problem is it a good idea to sort the array using a sorting technique with efficiency O(nlogn) and remove the duplicates? -- 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. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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] array pointer
we can equate base address of double dimension array to a pointer variable, tell me which one is correct. if n is a pointer variable and x[5][5] is double dimension array 1. n=x; 2. n=x[0][0]; 3. both -- 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] Samsung SISO Question
Given a rope of 10m , numbered at 1m i.e like 0 1 2 3 4 5 6 7 8 9 10 ||---|---|---|---|---|---|---|---|---| |---10m| One dry out it clothes of various length like 4m from 0-4 then of 2m from 6-8 then 6m from 2-8 and so on ,one on top of another , then u need to construct a data structure such that when seeing from the top u have to give the number of clothes drying , at one particular instance. -- Thanks and Regards *Karan Bagaria* *MCA Final Year* Training and Placement Representative -- 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] Duplicates in a string
We can do it in just one pass. Start scanning the array and whichever element gets scanned just store some kind of marker in the additional array that this element has been vsisted.Next time you get some element if that element (or character) is not visited earlier than mark it as visited and print it or if it was visited earlier just skip it. On Fri, Aug 5, 2011 at 8:30 PM, nishaanth nishaant...@gmail.com wrote: Store the frequency of all the letters in an array in one scan(like counting sort). In the next pass remove the duplicates and appropriately shift . takes 2 O(n) passes i guess On Fri, Aug 5, 2011 at 4:50 PM, priya v pria@gmail.com wrote: Remove duplicate alphabets from a string and compress it in the same string. For example, MISSISSIPPI becomes MISP. O (n2) is not acceptable. For this problem is it a good idea to sort the array using a sorting technique with efficiency O(nlogn) and remove the duplicates? -- 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. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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] Duplicates in a string
I think in this case count sort type thing would work better way just take a array of max 26(as 26 CHARACTER ARE THERE) and using index as count['M']=store how many times M has comes similary store other character now print array whose value 0 but IN this case u might lost the ORDER..(but that can be done using binary search using T(log(n)) the total time complexcity is O(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] Duplicates in a string
u can use a bool array size- 26 and do char[i]-'A' = 1 , check it to decide the first instance of the character. this can be done in O(n). u can even use bit mask to make ur code look better ( ;) ) On 8/5/11, priya v pria@gmail.com wrote: If an additional storage is used to store the frequency / marker searching the frequency/marker in the array would require an additional nested loop. Would it still be O(n)? On Fri, Aug 5, 2011 at 8:36 PM, kartik sachan kartik.sac...@gmail.comwrote: I think in this case count sort type thing would work better way just take a array of max 26(as 26 CHARACTER ARE THERE) and using index as count['M']=store how many times M has comes similary store other character now print array whose value 0 but IN this case u might lost the ORDER..(but that can be done using binary search using T(log(n)) the total time complexcity is O(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. -- 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: Duplicates in a string
static int array[256]; removedupli(char s[],int n) { array[s[0]]=1; for(i=1;in;i++) { if(array[s[i]]==0) array[s[i]]=1; else { for(pos=i;in;i++) s[pos]=s[pos+1]; i--; -- 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
Even adding positive numbers can be done in o(n) ryt !? On Fri, Aug 5, 2011 at 8:04 PM, muthu raj muthura...@gmail.com wrote: Yeah Kadanes algorithm. It can be done in O(n); *Muthuraj R IV th Year , ISE PESIT , Bangalore* On Fri, Aug 5, 2011 at 6:49 PM, Naren s sweetna...@gmail.com wrote: http://people.csail.mit.edu/bdean/6.046/dp/ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Printf
Its logical address !! On Fri, Aug 5, 2011 at 5:07 PM, Dipankar Patro dip10c...@gmail.com wrote: +1 to logical address. User programs are never given access to physical address. On 5 August 2011 17:00, muthu raj muthura...@gmail.com wrote: physical adress is never acessible.Those who claim physical adress pls support ur answers. *Muthuraj R IV th Year , ISE PESIT , Bangalore* On Fri, Aug 5, 2011 at 4:57 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: logical address On Fri, Aug 5, 2011 at 2:20 PM, Amol Sharma amolsharm...@gmail.comwrote: physical address i think -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Fri, Aug 5, 2011 at 1:01 AM, amit karmakar amit.codenam...@gmail.com wrote: Some discussions here, http://ubuntuforums.org/showthread.php?t=316081 and some here, http://groups.google.com/group/comp.lang.c/msg/21250e8fe083e4f8 On Aug 5, 12:51 pm, Anurag Narain anuragnar...@gmail.com wrote: i think logical address...physical address is never accessible to user program @amit-can u explain why?? -- 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, 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. -- 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. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- 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] Re: MICRSOFT WRITEN TEST
Q1 Find shortest distance pair of point among n points in a 2d space. soln:- CLRS(comp geomentry nlogn soln) Q2 design an elevator? soln:- use semaphores,syn construct etc. Q3 reverse every k nodes of a ll? there will be some o/p questions in c if applied for IDC profle and in C++ if applied for IT Profile of MS THEY WANT RUNNING CODE DUDE I MEAN RUNNING NO SINGLE ERROR SHOULD BE THERE -- 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] output???
coz by default all real values are converted to double and it is larger than float.ie real nos are not stored accurately inside computer memory.so since double occupies more memory it prints hi On Fri, Aug 5, 2011 at 8:24 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: the reason is dat 0.7 is treated as double..therefore double(0.7) float(0.7) On Fri, Aug 5, 2011 at 8:20 PM, kartik sachan kartik.sac...@gmail.comwrote: the output will be hi even if u have putted equal to sign there this is becoz 0.7 do not exactly stored like 0.7 in a but some thing lesser as describe in ASCII format that's why it is awlays lesser than 0.7 -- 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. -- 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] MICRSOFT WRITEN TEST
Ms written test besides objective test you will get three or four subjective questions which happened in our case: so be prepared for UML diagrams: There's high probability that the questions can repeat So do these:(don,t remember exactly b'coz i wasn't eligible to sit so writing the questions which i heard from others) .algorithm for implementing find and replace utility of notepad. .how to handel race condition in database. -- 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] probablity
I was given 3 packets, with 2 pens each. 1st Packet has 2 blue pens. 2nd Packet has 1 blue pen,1 black pen. 3rd Packet has 2 black pens. I took any one packet and pulled out one pen. It turned out to be a blue one. What is the probability that the next pen from the same packet will also be a blue one? -- 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] probablity
Jus use Baye's theorem.its a direct n simple app of dat:) On Fri, Aug 5, 2011 at 9:14 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: I was given 3 packets, with 2 pens each. 1st Packet has 2 blue pens. 2nd Packet has 1 blue pen,1 black pen. 3rd Packet has 2 black pens. I took any one packet and pulled out one pen. It turned out to be a blue one. What is the probability that the next pen from the same packet will also be a blue one? -- 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. -- 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] array pointer
n=x, is correct or n = x[0][0] is correct On 8/5/11, Arshad Alam alam3...@gmail.com wrote: we can equate base address of double dimension array to a pointer variable, tell me which one is correct. if n is a pointer variable and x[5][5] is double dimension array 1. n=x; 2. n=x[0][0]; 3. both -- 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. -- Laugh as much as you breathe and love as long as you live. -- 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] probablity
1/2 you got the blue pen so it is for sure that is one of the first two packets, so you are left with a black pen and a blue pen and you have to find the probability of finding a blue pen among them On Fri, Aug 5, 2011 at 9:14 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: I was given 3 packets, with 2 pens each. 1st Packet has 2 blue pens. 2nd Packet has 1 blue pen,1 black pen. 3rd Packet has 2 black pens. I took any one packet and pulled out one pen. It turned out to be a blue one. What is the probability that the next pen from the same packet will also be a blue one? -- 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. -- --- Puneet Goyal Student of B. Tech. III Year (Software Engineering) Delhi Technological University, Delhi --- -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Duplicates in a string
@deepikayour solution is not O(n) i guess... @Sachinthe question says compress the *same* string. By 'printing' i dont know what you mean On Fri, Aug 5, 2011 at 5:17 PM, deepikaanand swinyanand...@gmail.comwrote: static int array[256]; removedupli(char s[],int n) { array[s[0]]=1; for(i=1;in;i++) { if(array[s[i]]==0) array[s[i]]=1; else { for(pos=i;in;i++) s[pos]=s[pos+1]; i--; -- 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. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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] output???
Thanks to all On Fri, Aug 5, 2011 at 8:53 PM, sukran dhawan sukrandha...@gmail.comwrote: coz by default all real values are converted to double and it is larger than float.ie real nos are not stored accurately inside computer memory.so since double occupies more memory it prints hi On Fri, Aug 5, 2011 at 8:24 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: the reason is dat 0.7 is treated as double..therefore double(0.7) float(0.7) On Fri, Aug 5, 2011 at 8:20 PM, kartik sachan kartik.sac...@gmail.comwrote: the output will be hi even if u have putted equal to sign there this is becoz 0.7 do not exactly stored like 0.7 in a but some thing lesser as describe in ASCII format that's why it is awlays lesser than 0.7 -- 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. -- 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 Rajesh Kumar -- 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] probablity
i agree with puneet. 1/2 On Fri, Aug 5, 2011 at 9:18 PM, Puneet Goyal puneetgoya...@gmail.comwrote: 1/2 you got the blue pen so it is for sure that is one of the first two packets, so you are left with a black pen and a blue pen and you have to find the probability of finding a blue pen among them On Fri, Aug 5, 2011 at 9:14 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: I was given 3 packets, with 2 pens each. 1st Packet has 2 blue pens. 2nd Packet has 1 blue pen,1 black pen. 3rd Packet has 2 black pens. I took any one packet and pulled out one pen. It turned out to be a blue one. What is the probability that the next pen from the same packet will also be a blue one? -- 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. -- --- Puneet Goyal Student of B. Tech. III Year (Software Engineering) Delhi Technological University, Delhi --- -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Duplicates in a string
@priya its some thing like this for(i=0;a[i]!='\0';i++) count['a[i]']++; so its O(n) only -- 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] probablity
5/6 On Fri, Aug 5, 2011 at 5:55 PM, Rahul Jain rahuljai...@gmail.com wrote: i agree with puneet. 1/2 On Fri, Aug 5, 2011 at 9:18 PM, Puneet Goyal puneetgoya...@gmail.comwrote: 1/2 you got the blue pen so it is for sure that is one of the first two packets, so you are left with a black pen and a blue pen and you have to find the probability of finding a blue pen among them On Fri, Aug 5, 2011 at 9:14 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: I was given 3 packets, with 2 pens each. 1st Packet has 2 blue pens. 2nd Packet has 1 blue pen,1 black pen. 3rd Packet has 2 black pens. I took any one packet and pulled out one pen. It turned out to be a blue one. What is the probability that the next pen from the same packet will also be a blue one? -- 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. -- --- Puneet Goyal Student of B. Tech. III Year (Software Engineering) Delhi Technological University, Delhi --- -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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: Printf
Logical Address ... as Physical address is not accessable tht's wht OS does , it maps the physical address to the logical address . -- 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] probablity
@Nishant.. Can u please explain ur approach.. I think its as per mentioned above 1/2... On 5 Aug 2011 21:30, nishaanth nishaant...@gmail.com wrote: 5/6 On Fri, Aug 5, 2011 at 5:55 PM, Rahul Jain rahuljai...@gmail.com wrote: i agree with puneet. 1/2 On Fri, Aug 5, 2011 at 9:18 PM, Puneet Goyal puneetgoya...@gmail.com wrote: 1/2 you got the blue pen so it is for sure that is one of the first two packets, so you are left with a black pen and a blue pen and you have to find the probability of finding a blue pen among them On Fri, Aug 5, 2011 at 9:14 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: I was given 3 packets, with 2 pens each. 1st Packet has 2 blue pens. 2nd Packet has 1 blue pen,1 black pen. 3rd Packet has 2 black pens. I took any one packet and pulled out one pen. It turned out to be a blue one. What is the probability that the next pen from the same packet will also be a blue one? -- 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. -- --- Puneet Goyal Student of B. Tech. III Year (Software Engineering) Delhi Technological University, Delhi --- -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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] array pointer
1 On Fri, Aug 5, 2011 at 5:47 PM, mohit goyal mohitgoya...@gmail.com wrote: n=x, is correct or n = x[0][0] is correct On 8/5/11, Arshad Alam alam3...@gmail.com wrote: we can equate base address of double dimension array to a pointer variable, tell me which one is correct. if n is a pointer variable and x[5][5] is double dimension array 1. n=x; 2. n=x[0][0]; 3. both -- 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. -- Laugh as much as you breathe and love as long as you live. -- 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. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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: MICRSOFT WRITEN TEST
ques ll be simple but they expect solid,secure,scalable, and efficent code .. for instance.. they asked merging 2 sorted LL.. .. ppl who forgot to check d simple condition...say .. if(head==NULL)return; were eliminated On Aug 5, 8:28 pm, raj kumar megamonste...@gmail.com wrote: Ms written test besides objective test you will get three or four subjective questions which happened in our case: so be prepared for UML diagrams: There's high probability that the questions can repeat So do these:(don,t remember exactly b'coz i wasn't eligible to sit so writing the questions which i heard from others) .algorithm for implementing find and replace utility of notepad. .how to handel race condition in database. -- 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] simple doubt
i think both are erroneous. first statement i think you are trying to change the array address which is not possible. second statementarr doesn't make any sense i guess arr gives the address but arr is not allowed On Fri, Aug 5, 2011 at 4:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote: but u initialized **dp means . ex-dp=p and p=arr then its correct so dp contains addr of p which inturns contains addrof arr now **dp is correct initialization. On Fri, Aug 5, 2011 at 7:45 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote: i see but is not arr a pointer to first array element and so arr contain address of that pointer ? On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar vijaykhand...@gmail.comwrote: I dont think so dp=arr; since **dp; dp contains the addr of another ptr variable... On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan aaron.nar...@gmail.com wrote: I guess someone had posted a link earlier from which I have a basic doubt when u have int arr[3]={1,0,2}; int **dp; int (*pa)[3]; is this the right assingment for instance? pa=arr; dp=arr; or have I flipped the ampersand in assigning? Also when I do pa++ will it jump by size of int or the whole array size it points to? -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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] simple doubt
i think 1st is wrong bt 2nd is correct.. On Fri, Aug 5, 2011 at 9:51 PM, nishaanth nishaant...@gmail.com wrote: i think both are erroneous. first statement i think you are trying to change the array address which is not possible. second statementarr doesn't make any sense i guess arr gives the address but arr is not allowed On Fri, Aug 5, 2011 at 4:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote: but u initialized **dp means . ex-dp=p and p=arr then its correct so dp contains addr of p which inturns contains addrof arr now **dp is correct initialization. On Fri, Aug 5, 2011 at 7:45 PM, Arun Vishwanathan aaron.nar...@gmail.com wrote: i see but is not arr a pointer to first array element and so arr contain address of that pointer ? On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar vijaykhand...@gmail.comwrote: I dont think so dp=arr; since **dp; dp contains the addr of another ptr variable... On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan aaron.nar...@gmail.com wrote: I guess someone had posted a link earlier from which I have a basic doubt when u have int arr[3]={1,0,2}; int **dp; int (*pa)[3]; is this the right assingment for instance? pa=arr; dp=arr; or have I flipped the ampersand in assigning? Also when I do pa++ will it jump by size of int or the whole array size it points to? -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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 Himanshu Kansal Msc Comp. sc. (University of 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.
[algogeeks] a C question
#includestdio.h main() { long x; float t; scanf(%f,t); printf(%d\n,t); x=90; printf(%f\n,x); { x=1; printf(%f\n,x); { x=30; printf(%f\n,x); } printf(%f\n,x); } x==9; printf(%f\n,x); getch(); } o/p (when i had given input as 67 this is the output) 0 67.0 67.0 67.0 67.0 67.0 can anyone explain me he output.. Thanks Snehi -- 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] Structure Q
it should be head-x=100 ryt??? On 5 August 2011 17:32, Vijay Khandar vijaykhand...@gmail.com wrote: Thanks On Fri, Aug 5, 2011 at 5:25 PM, SANDEEP CHUGH sandeep.aa...@gmail.comwrote: ERROR On Fri, Aug 5, 2011 at 5:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote: struct list { int x; struct list *next; }*head; The statement head.x=100 A)assigns 100 to one element of the structure list B)creates a node of type list and assigns a value to x C)creates a head of the list D)error Plz anyone provide correct option with explanation.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Jyoti Gupta COE , 4th year Delhi College of Engineering -- 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] simple doubt
first one is right and second is wrong.because dp will store address of pointer and here you are storing address of int array. -- 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] Structure Q
head-x=100 is not right if you will first declare head=new list; head-x=100; will be right. -- 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: Duplicates in a string
#includestring.h int main () { char str[]=hello world; int i,j=0,checker=0; for(i=0;istrlen(str);i++) { int val=str[i]-'a'; if ((checker(1val))=0) str[j++]=str[i]; checker|=(1val); } str[j]='\0'; printf(%s,str); return 0; } -- 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] Structure Q
yes... it would be error ...to be specific it is segmentation faultyou are trying to access a memory which do not exist -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Fri, Aug 5, 2011 at 10:21 PM, pankaj kumar pancsen...@gmail.com wrote: head-x=100 is not right if you will first declare head=new list; head-x=100; will be right. -- 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] array pointer
we can equate base address of double dimension array to a pointer variable, tell me which one is correct. if n is a pointer variable and x[5][5] is double dimension array 1. n=x; 2. n=x[0][0]; 3. both -- 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: Duplicates in a string
@all : Thanks a lot for the solutions! On Fri, Aug 5, 2011 at 10:31 PM, hary rathor harry.rat...@gmail.com wrote: #includestring.h int main () { char str[]=hello world; int i,j=0,checker=0; for(i=0;istrlen(str);i++) { int val=str[i]-'a'; if ((checker(1val))=0) str[j++]=str[i]; checker|=(1val); } str[j]='\0'; printf(%s,str); return 0; } -- 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] array pointer
1 On Fri, Aug 5, 2011 at 10:35 PM, Arshad Alam alam3...@gmail.com wrote: we can equate base address of double dimension array to a pointer variable, tell me which one is correct. if n is a pointer variable and x[5][5] is double dimension array 1. n=x; 2. n=x[0][0]; 3. both -- 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. -- Manish Kumar Sharma, Undergraduate, Computer Engg. Department., Netaji Subhas Institute of Technology, New Delhi. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Duplicates in a string
int b[26]={0}; vectorcharc; for(i=0;a[i];i++) { if(!b[(a[i]-65)]) { b[(a[i]-65)]++; c.push_back(a[i]); } } for(i=0;ic.size();i++) coutc[i]; } -- 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] Makemytrip.com
half an hour Aptitude test , after that half an hour written test , then Technical rounds (2-3) and then HR profile Software dev - 6 lacs QA - 5 lacs -- 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: Duplicates in a string
Can You please explain this bit manipualtion On Fri, Aug 5, 2011 at 10:31 PM, hary rathor harry.rat...@gmail.com wrote: #includestring.h int main () { char str[]=hello world; int i,j=0,checker=0; for(i=0;istrlen(str);i++) { int val=str[i]-'a'; if ((checker(1val))=0) str[j++]=str[i]; checker|=(1val); } str[j]='\0'; printf(%s,str); return 0; } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Duplicates in a string
when you encounter the letter for first time then simply increment array having index=(ASCII value-65) and put that in vector next time when you will encounter the same variable again then condition will fail hence no change in content of vector hence in the end simply print the vector -- 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] Makemytrip.com
coming for which branch?? -- 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] difference between the two
Whats the difference between the two ? 1) struct list { int data; list *next; } and 2) struct list { list *next; int data; } -- 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] Makemytrip.com
CS,IT,ECE -- 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: Duplicates in a string
i have used 26 bit of checker variable then i have checked in if statemet that if bit is set there then put then character in jth posion, then set the the bit for character -- 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] simple doubt
both are wrong.run and see that warning will be displayed !! -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Fri, Aug 5, 2011 at 10:17 PM, pankaj kumar pancsen...@gmail.com wrote: first one is right and second is wrong.because dp will store address of pointer and here you are storing address of int array. -- 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] difference between the two
no ,if u r using 32 bit machine . that will use 4 byte pointer size , but in 64 machine that enforce to be size of 8 . where padding will take int your given first structure so for 32 bit- size will 8 8 for both structure for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in one structure hence 2nd structure is good for use -- 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] array pointer
1 -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Fri, Aug 5, 2011 at 10:37 PM, Manish Sharma manish.manishkumar.shar...@gmail.com wrote: 1 On Fri, Aug 5, 2011 at 10:35 PM, Arshad Alam alam3...@gmail.com wrote: we can equate base address of double dimension array to a pointer variable, tell me which one is correct. if n is a pointer variable and x[5][5] is double dimension array 1. n=x; 2. n=x[0][0]; 3. both -- 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. -- Manish Kumar Sharma, Undergraduate, Computer Engg. Department., Netaji Subhas Institute of Technology, New Delhi. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Goldman sachs intern
guys please post the questions On Aug 5, 3:13 pm, arvind kumar arvindk...@gmail.com wrote: NIT ALLAHABAD guys!! Please share your experiences abt Goldman sachs recruitment.. -- 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] difference between the two
in case of 64 bit machine y doesn't padding happen in the 2nd structure? On Fri, Aug 5, 2011 at 11:21 PM, hary rathor harry.rat...@gmail.com wrote: no ,if u r using 32 bit machine . that will use 4 byte pointer size , but in 64 machine that enforce to be size of 8 . where padding will take int your given first structure so for 32 bit- size will 8 8 for both structure for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in one structure hence 2nd structure is good for use -- 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]
mynode* reverse_recurse(mynode *root) { if(root-next!=(mynode *)0) { reverse_recurse(root-next); root-next-next=root; return(root); } else { head=root; } } how does it reverses the singly linked list -- *Rajeshwar Patra,* *MCA final year,* *Nit Durgapur* -- 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] array pointer
I THINK THIS WILL CLEAR YOUR DOUBT x = address of first element of array=x[0][0] *x=addrss of x[0][0]; **x=x[0][0] x=address of x[0][0]; x[0]=address of x[0][0]; x[1]=address of x[1][0] *x[2]=address of x[2][0]; so 2 is wrong -- *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.
[algogeeks] Re: Circle
// Draw a circle with center (x,y) and radius r circle(int x, int y, int r) { int a = 0; int b = r; while(a = b) { // Draw the current location in all 4 quadrants plot(x+a, y+b); plot(x-a, y+b); plot(x+a, y-b); plot(x-a, y-b); plot(x+b, y+a); plot(x-b, y+a); plot(x+b, y-a); plot(x-b, y-a); // Look at two possible next points and pick the better int delta1 = r*r - (a+1)*(a+1) - b*b; int delta2 = r*r - a*a - (b-1)*(b-1); if (delta1*delta1 delta2*delta2) ++a; else --b; } } On Aug 5, 8:38 am, rShetty rajeevr...@gmail.com wrote: Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all. -- 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] difference between the two
I think voth are just same.. On Fri, Aug 5, 2011 at 10:57 AM, priya v pria@gmail.com wrote: in case of 64 bit machine y doesn't padding happen in the 2nd structure? On Fri, Aug 5, 2011 at 11:21 PM, hary rathor harry.rat...@gmail.comwrote: no ,if u r using 32 bit machine . that will use 4 byte pointer size , but in 64 machine that enforce to be size of 8 . where padding will take int your given first structure so for 32 bit- size will 8 8 for both structure for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in one structure hence 2nd structure is good for use -- 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 2nd Year @MNNIT ALLAHABAD* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] a C question
The culprit in this program is printing a float variable with %d specifier. printf(%d\n, t); Removing this line, the program behaves normally. This line may crash your program. Also it may remove some bytes from your stack. I feel this is what happening. Even I am not very convinced. Still trying to find out !!! On Fri, Aug 5, 2011 at 9:57 PM, snehi jain snehijai...@gmail.com wrote: #includestdio.h main() { long x; float t; scanf(%f,t); printf(%d\n,t); x=90; printf(%f\n,x); { x=1; printf(%f\n,x); { x=30; printf(%f\n,x); } printf(%f\n,x); } x==9; printf(%f\n,x); getch(); } o/p (when i had given input as 67 this is the output) 0 67.0 67.0 67.0 67.0 67.0 can anyone explain me he output.. Thanks Snehi -- 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. -- Mithun.B.S M:9916775380 -- 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: probablity
according to me it is 1/3 read the line carefully What is the probability that the next pen from the same packet will also be a blue one? since it is said the first pen was blue and second pen must also be blue. for it to happen 1st packet contaning all blue pen should be selected whose probablity of selection is 1/3 On Aug 5, 9:06 pm, nishaanth nishaant...@gmail.com wrote: Bayes theorem... Approach : P(pen from packet 1 | Blue) =2/3 (from Bayes rule) P(pen from packet 2 | Blue) =1/3 Req prob = 2/3 + 1/3 . 1/2 =5/6 On Fri, Aug 5, 2011 at 6:02 PM, abhishek iyer abhishekr.iye...@gmail.comwrote: @Nishant.. Can u please explain ur approach.. I think its as per mentioned above 1/2... On 5 Aug 2011 21:30, nishaanth nishaant...@gmail.com wrote: 5/6 On Fri, Aug 5, 2011 at 5:55 PM, Rahul Jain rahuljai...@gmail.com wrote: i agree with puneet. 1/2 On Fri, Aug 5, 2011 at 9:18 PM, Puneet Goyal puneetgoya...@gmail.com wrote: 1/2 you got the blue pen so it is for sure that is one of the first two packets, so you are left with a black pen and a blue pen and you have to find the probability of finding a blue pen among them On Fri, Aug 5, 2011 at 9:14 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: I was given 3 packets, with 2 pens each. 1st Packet has 2 blue pens. 2nd Packet has 1 blue pen,1 black pen. 3rd Packet has 2 black pens. I took any one packet and pulled out one pen. It turned out to be a blue one. What is the probability that the next pen from the same packet will also be a blue one? -- 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. -- --- Puneet Goyal Student of B. Tech. III Year (Software Engineering) Delhi Technological University, Delhi --- -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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] simple doubt
1st is right, n when you do pa++, it will jump by size of 1st one-D array(in case array is of more than one dimension), even in this case, it'll jump by the whole array size(6). On 5 August 2011 23:20, Amol Sharma amolsharm...@gmail.com wrote: both are wrong.run and see that warning will be displayed !! -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Fri, Aug 5, 2011 at 10:17 PM, pankaj kumar pancsen...@gmail.comwrote: first one is right and second is wrong.because dp will store address of pointer and here you are storing address of int array. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Structure Q
only by declaring head and then doing head.x=100 is wrongbecause head is only apointer that can store address of only a list type of variable...whwn we allocate memmory by malloc or new then you can do head-x=100..and head.x is wrong ...use either head-x=100 or (*head).x=100 *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @MNNIT ALLAHABAD* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] simple doubt
@nishant : where is the array address getting changed in first one? it just says pa=arr isnt arr address of the pointer to the first element of the array? On Fri, Aug 5, 2011 at 6:21 PM, nishaanth nishaant...@gmail.com wrote: i think both are erroneous. first statement i think you are trying to change the array address which is not possible. second statementarr doesn't make any sense i guess arr gives the address but arr is not allowed On Fri, Aug 5, 2011 at 4:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote: but u initialized **dp means . ex-dp=p and p=arr then its correct so dp contains addr of p which inturns contains addrof arr now **dp is correct initialization. On Fri, Aug 5, 2011 at 7:45 PM, Arun Vishwanathan aaron.nar...@gmail.com wrote: i see but is not arr a pointer to first array element and so arr contain address of that pointer ? On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar vijaykhand...@gmail.comwrote: I dont think so dp=arr; since **dp; dp contains the addr of another ptr variable... On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan aaron.nar...@gmail.com wrote: I guess someone had posted a link earlier from which I have a basic doubt when u have int arr[3]={1,0,2}; int **dp; int (*pa)[3]; is this the right assingment for instance? pa=arr; dp=arr; or have I flipped the ampersand in assigning? Also when I do pa++ will it jump by size of int or the whole array size it points to? -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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. -- S.Nishaanth, Computer Science and engineering, IIT Madras. -- 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. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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] simple doubt
@amol: hmm but I would like to know the reason for it if it is so On Fri, Aug 5, 2011 at 7:50 PM, Amol Sharma amolsharm...@gmail.com wrote: both are wrong.run and see that warning will be displayed !! -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Fri, Aug 5, 2011 at 10:17 PM, pankaj kumar pancsen...@gmail.comwrote: first one is right and second is wrong.because dp will store address of pointer and here you are storing address of int array. -- 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. -- People often say that motivation doesn't last. Well, neither does bathing - that's why we recommend it daily. -- 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] simple doubt
int (*pa)[3]; pa is a pointer to an array of 3 elements for example in x[3] to xin z[4][3] to z[0],z[1],z[2],z[3].so pa=arr is correct and ..dp is a pointer that sore address of a pointer so dp=a will give only warning but you can't do **dp in this case *UTKARSH SRIVASTAV CSE-3 B-Tech 3rd Year @MNNIT ALLAHABAD* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] simple doubt
(*pa)[3] ;// pa is array of pointers to int type; so pa = arr; doesn't make any sense ,bcoz arr represents the base address of it(address of arr[0]). and pa represent the address of pa[0](which hold a pointer). I hope it's clear now -- 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: Circle
@Don: The sequence of points (x+a, y+b) generated by your algorithm moves along the arc of the circle from theta = 90 degrees to theta = 45 degrees. Along this arc, the slope of the curve is -1 = dy/dx = 0. Thus, rather than moving from (x+a, y+b) to either (x+a+1, y+b) or (x+a, y+b-1), you should be moving to either (x+a+1, y+b) or (x+a+1, y +b-1). In words, you always increase a, and decrease b when that gets you closer to the circle. Furthermore, you can algebraically simplify the comparison so that no multiplications are required. See, e.g., http://homepage.smc.edu/kennedy_john/bcircle.pdf. Dave On Aug 5, 1:06 pm, Don dondod...@gmail.com wrote: // Draw a circle with center (x,y) and radius r circle(int x, int y, int r) { int a = 0; int b = r; while(a = b) { // Draw the current location in all 4 quadrants plot(x+a, y+b); plot(x-a, y+b); plot(x+a, y-b); plot(x-a, y-b); plot(x+b, y+a); plot(x-b, y+a); plot(x+b, y-a); plot(x-b, y-a); // Look at two possible next points and pick the better int delta1 = r*r - (a+1)*(a+1) - b*b; int delta2 = r*r - a*a - (b-1)*(b-1); if (delta1*delta1 delta2*delta2) ++a; else --b; } } On Aug 5, 8:38 am, rShetty rajeevr...@gmail.com wrote: Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: probablity
@shiv : you are considering the case when you need to know the probability of both pens being blue, but in the question you already know that 1st one is blue so you dont need to care about it, and also the 3rd packet getting eliminated coz of it increases the probability to 1/2 -- 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] difference between the two
in case of 64 bit, size of second structure will also be 16 not 8 On Fri, Aug 5, 2011 at 11:40 PM, UTKARSH SRIVASTAV usrivastav...@gmail.comwrote: I think voth are just same.. On Fri, Aug 5, 2011 at 10:57 AM, priya v pria@gmail.com wrote: in case of 64 bit machine y doesn't padding happen in the 2nd structure? On Fri, Aug 5, 2011 at 11:21 PM, hary rathor harry.rat...@gmail.comwrote: no ,if u r using 32 bit machine . that will use 4 byte pointer size , but in 64 machine that enforce to be size of 8 . where padding will take int your given first structure so for 32 bit- size will 8 8 for both structure for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in one structure hence 2nd structure is good for use -- 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 2nd 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. -- 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.
[algogeeks] To reverse a linked list
What is the error in the program? I tried to run it on ideone, but its giving runtime error. This is a program to reverse a linked list. #includestdio.h #includemalloc.h int count=0; struct try{ int data; struct try *next; }; typedef struct try node; node *head,*head2; void reverse(node *list, int k) { if(!k) { head=list-next; return; } if(list-next==NULL) return; reverse(list-next,k-1); if(k==1) head2=list-next; list-next-next=list; list-next=NULL; } void add(node *list,int a) { node *temp; temp=malloc(sizeof(node)); temp-data=a; temp-next=NULL; if(list==NULL) list=temp; else { temp-next=list; list=temp; } } void print(node *list) { while(list-next!=NULL) printf(%d,list-data); } void del(node *list) { node *temp; while(list!=NULL) { temp=list; free(list); list=temp-next; } } int main() { int k; node *list; scanf(%d,k); list=NULL; add(list,10); add(list,20); add(list,30); add(list,40); add(list,50); add(list,60); print(list); reverse(list,k-1); list-next=head; print(head2); del(head2); return 0; } -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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: a C question
well I don't have explanations but this happens because the floats,ints and longs , they are stored differently in memory. -- 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: To reverse a linked list
Sorry. this program reverses the 1st k nodes of the linked list. Not the entire list. On Sat, Aug 6, 2011 at 12:48 AM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: What is the error in the program? I tried to run it on ideone, but its giving runtime error. This is a program to reverse a linked list. #includestdio.h #includemalloc.h int count=0; struct try{ int data; struct try *next; }; typedef struct try node; node *head,*head2; void reverse(node *list, int k) { if(!k) { head=list-next; return; } if(list-next==NULL) return; reverse(list-next,k-1); if(k==1) head2=list-next; list-next-next=list; list-next=NULL; } void add(node *list,int a) { node *temp; temp=malloc(sizeof(node)); temp-data=a; temp-next=NULL; if(list==NULL) list=temp; else { temp-next=list; list=temp; } } void print(node *list) { while(list-next!=NULL) printf(%d,list-data); } void del(node *list) { node *temp; while(list!=NULL) { temp=list; free(list); list=temp-next; } } int main() { int k; node *list; scanf(%d,k); list=NULL; add(list,10); add(list,20); add(list,30); add(list,40); add(list,50); add(list,60); print(list); reverse(list,k-1); list-next=head; print(head2); del(head2); return 0; } -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- 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] output???
ha ha its not like it stores slightly less than actual :P :P try this float a=0.5,b=1.0,c=0.7; if(0.5==a) printf(yes a=0.5\n); if(1.0==b) printf(yes b=1.0\n); if(0.7!=c) printf(Yes c!=0.7\n); o/p will be yes a=0.5 yes b=1.0 yes c!=0.7 check it out i will explain it later... On Fri, Aug 5, 2011 at 9:26 PM, Rajesh Kumar testalgori...@gmail.comwrote: Thanks to all On Fri, Aug 5, 2011 at 8:53 PM, sukran dhawan sukrandha...@gmail.comwrote: coz by default all real values are converted to double and it is larger than float.ie real nos are not stored accurately inside computer memory.so since double occupies more memory it prints hi On Fri, Aug 5, 2011 at 8:24 PM, Kamakshii Aggarwal kamakshi...@gmail.com wrote: the reason is dat 0.7 is treated as double..therefore double(0.7) float(0.7) On Fri, Aug 5, 2011 at 8:20 PM, kartik sachan kartik.sac...@gmail.comwrote: the output will be hi even if u have putted equal to sign there this is becoz 0.7 do not exactly stored like 0.7 in a but some thing lesser as describe in ASCII format that's why it is awlays lesser than 0.7 -- 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. -- 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 Rajesh Kumar -- 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 SAGAR PAREEK 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.
[algogeeks] Re: output???
its due to precision limit of double is larger than float, and by default real values are stored as double so constant 0.7 is stored more accurately(8 bytes) that float a=0.7 (4 bytes). and when comparing the two float is typecasted into double and so the ramaining bits are padded with 0 so 0.7 a; -- 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: output???
@vikas first read what i wrote On Sat, Aug 6, 2011 at 12:59 AM, vikash vikash.ckiiit...@gmail.com wrote: its due to precision limit of double is larger than float, and by default real values are stored as double so constant 0.7 is stored more accurately(8 bytes) that float a=0.7 (4 bytes). and when comparing the two float is typecasted into double and so the ramaining bits are padded with 0 so 0.7 a; -- 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 SAGAR PAREEK 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.
Re: [algogeeks] Makemytrip.com
thanks for the information .. the technical round had MCQs or coding questions ?? On Fri, Aug 5, 2011 at 11:09 PM, parag khanna khanna.para...@gmail.comwrote: CS,IT,ECE -- 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] Makemytrip.com
both -- 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: To reverse a linked list
It's easy if you think in terms of pop and push operations. Pop the first k elements off the head of the list and push them onto a new list. They're now in reverse order. All that's left is to connect the two lists. You can do this efficiently if you keep a pointer to the tail element. NODE *reverse_k(NODE *lst, int k) { NODE *reversed = NULL, *tail = null; int i; for (i = 0; i k; i++) { // pop the list head NODE *popped = lst; lst = lst-next; // push onto the reversed prefix popped-next = reversed; reversed = popped; // remember the tail of the reversed list if (tail == NULL) tail = reversed; } // glue the rest of the list onto the tail tail-next = lst; // the reversed prefix is the new list return reversed; } This is an awkward problem to do with recursion. You will essentially end up implementing the loop above with tail recursion. In my opinion, the loop is clearer in this case. On Aug 5, 3:21 pm, Nikhil Gupta nikhilgupta2...@gmail.com wrote: Sorry. this program reverses the 1st k nodes of the linked list. Not the entire list. On Sat, Aug 6, 2011 at 12:48 AM, Nikhil Gupta nikhilgupta2...@gmail.comwrote: What is the error in the program? I tried to run it on ideone, but its giving runtime error. This is a program to reverse a linked list. #includestdio.h #includemalloc.h int count=0; struct try{ int data; struct try *next; }; typedef struct try node; node *head,*head2; void reverse(node *list, int k) { if(!k) { head=list-next; return; } if(list-next==NULL) return; reverse(list-next,k-1); if(k==1) head2=list-next; list-next-next=list; list-next=NULL; } void add(node *list,int a) { node *temp; temp=malloc(sizeof(node)); temp-data=a; temp-next=NULL; if(list==NULL) list=temp; else { temp-next=list; list=temp; } } void print(node *list) { while(list-next!=NULL) printf(%d,list-data); } void del(node *list) { node *temp; while(list!=NULL) { temp=list; free(list); list=temp-next; } } int main() { int k; node *list; scanf(%d,k); list=NULL; add(list,10); add(list,20); add(list,30); add(list,40); add(list,50); add(list,60); print(list); reverse(list,k-1); list-next=head; print(head2); del(head2); return 0; } -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India -- Nikhil Gupta Senior Co-ordinator, Publicity CSI, NSIT Students' Branch NSIT, New Delhi, India- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Samsung Written
aptitude test 1 hour quantitative and general reasoning technical round 30 min. then interview On Aug 5, 5:20 pm, parag khanna khanna.para...@gmail.com wrote: Apti 1 hour -- 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: output???
I think it is because the numbers like 0.7 do not have a exact binary representation,so they are not exactly represented in float,while the constant is internally implemented as double.,Read this:: http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=integersReals -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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] help on string manipulation bit manipulation
i have seen plenty of questions on string manipulation and bits operations asked in various comcanies exams. any one give me some good links where i can find some really good tutorials on string manipulation. -- 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] Samsung SISO Question
can u plz xplain d qstn a litl more thanx On Fri, Aug 5, 2011 at 8:33 PM, bagaria.ka...@gmail.com bagaria.ka...@gmail.com wrote: Given a rope of 10m , numbered at 1m i.e like 0 1 2 3 4 5 6 7 8 9 10 ||---|---|---|---|---|---|---|---|---| |---10m| One dry out it clothes of various length like 4m from 0-4 then of 2m from 6-8 then 6m from 2-8 and so on ,one on top of another , then u need to construct a data structure such that when seeing from the top u have to give the number of clothes drying , at one particular instance. -- Thanks and Regards *Karan Bagaria* *MCA Final Year* Training and Placement Representative -- 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] Samsung SISO Question
U can use merge sort for this.. try and picture the problem, u'll get my point.. On Fri, Aug 5, 2011 at 1:27 PM, amit kumar amitthecoo...@gmail.com wrote: can u plz xplain d qstn a litl more thanx On Fri, Aug 5, 2011 at 8:33 PM, bagaria.ka...@gmail.com bagaria.ka...@gmail.com wrote: Given a rope of 10m , numbered at 1m i.e like 0 1 2 3 4 5 6 7 8 9 10 ||---|---|---|---|---|---|---|---|---| |---10m| One dry out it clothes of various length like 4m from 0-4 then of 2m from 6-8 then 6m from 2-8 and so on ,one on top of another , then u need to construct a data structure such that when seeing from the top u have to give the number of clothes drying , at one particular instance. -- Thanks and Regards *Karan Bagaria* *MCA Final Year* Training and Placement Representative -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: output???
yup exactly On Sat, Aug 6, 2011 at 1:51 AM, Piyush Kapoor pkjee2...@gmail.com wrote: I think it is because the numbers like 0.7 do not have a exact binary representation,so they are not exactly represented in float,while the constant is internally implemented as double.,Read this:: http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=integersReals -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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 SAGAR PAREEK 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.
Re: [algogeeks] hash table
yes you can... for randomness , the key value will be key=rand() and now implement your hash function with this key. On Fri, Aug 5, 2011 at 4:53 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: can we implement random() function on a hash table in O(1) . -- 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. -- *MOHIT VERMA* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: output???
sagar - i dint get u, d code thing! Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering On Sat, Aug 6, 2011 at 2:31 AM, sagar pareek sagarpar...@gmail.com wrote: yup exactly On Sat, Aug 6, 2011 at 1:51 AM, Piyush Kapoor pkjee2...@gmail.com wrote: I think it is because the numbers like 0.7 do not have a exact binary representation,so they are not exactly represented in float,while the constant is internally implemented as double.,Read this:: http://www.topcoder.com/tc?module=Staticd1=tutorialsd2=integersReals -- *Regards,* *Piyush Kapoor,* *2nd year,CSE IT-BHU* -- 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 SAGAR PAREEK 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. -- 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] difference between the two
i dont understand the diff btw dem, could u plz elaborate? Shashank Jain IIIrd year Computer Engineering Delhi College of Engineering On Sat, Aug 6, 2011 at 12:32 AM, Kamakshii Aggarwal kamakshi...@gmail.comwrote: in case of 64 bit, size of second structure will also be 16 not 8 On Fri, Aug 5, 2011 at 11:40 PM, UTKARSH SRIVASTAV usrivastav...@gmail.com wrote: I think voth are just same.. On Fri, Aug 5, 2011 at 10:57 AM, priya v pria@gmail.com wrote: in case of 64 bit machine y doesn't padding happen in the 2nd structure? On Fri, Aug 5, 2011 at 11:21 PM, hary rathor harry.rat...@gmail.comwrote: no ,if u r using 32 bit machine . that will use 4 byte pointer size , but in 64 machine that enforce to be size of 8 . where padding will take int your given first structure so for 32 bit- size will 8 8 for both structure for 64 bit - size will 16 and 12 respectively cause of 4 bit padding in one structure hence 2nd structure is good for use -- 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 2nd 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. -- 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. -- 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] MS question
Give an efficient algorithm to determine which part of the video should be displayed as a thumbnail?? -- 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.