Re: [algogeeks] Flip kart
wats eligibility n package? On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek sagarpar...@gmail.comwrote: nit allahabad On Thu, Sep 22, 2011 at 12:20 AM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: which college may i know? On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek sagarpar...@gmail.comwrote: it is coming in my college On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: How did u applied for it? Can you please let me know.. On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek sagarpar...@gmail.comwrote: Hello ... Do anyone know the process and questions of flip kart ?? -- **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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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.
[algogeeks] help nedded
i found a question of ms earlier but know i not able to find it.plz post link or thread i/p::a3b2c4: o/p:aaabb i/p:aaabbc o/p:a3b2c1 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: question
starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no 439877238932[6]{987[3]} now sort in decreasing order 439877238932[6]{3789} this is the required no correct me if any thing wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] THANX ALGOGEEKS !!!!!!
plz post the written test n interview question...thnx in advance On Thu, Sep 22, 2011 at 8:59 AM, saurabh sah.saurab...@gmail.com wrote: I sincerely thank this group as i got selected in Microsoft IDC only because of this group . It was a wonderful experience for me at the interviews because the some of questions were closely related to the questions discussed here . And i also got to know about book Crackin the Coding Interviews which is more than sufficient for any company interviews from this group only . Finally i thank all those group members who shared their experiences and others who replied to their queries . GOOD LUCK to all Saurabh Sah Final Year, B.Tech MNIT JAIPUR -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: THANX ALGOGEEKS !!!!!!
congrats :) and share ur experiences On Sep 22, 11:28 am, rahul sharma rahul23111...@gmail.com wrote: plz post the written test n interview question...thnx in advance On Thu, Sep 22, 2011 at 8:59 AM, saurabh sah.saurab...@gmail.com wrote: I sincerely thank this group as i got selected in Microsoft IDC only because of this group . It was a wonderful experience for me at the interviews because the some of questions were closely related to the questions discussed here . And i also got to know about book Crackin the Coding Interviews which is more than sufficient for any company interviews from this group only . Finally i thank all those group members who shared their experiences and others who replied to their queries . GOOD LUCK to all Saurabh Sah Final Year, B.Tech MNIT JAIPUR -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: question
@kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no 439877238932[6]{987[3]} now sort in decreasing order 439877238932[6]{3789} this is the required no correct me if any thing wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ratan Kumar B. Tech 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] MICROSOFT IDC
Congrats !!!1 -- Regards Suraj Fale +91-9766103115 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] THANX ALGOGEEKS !!!!!!
Congrats dude... On 22 September 2011 07:29, saurabh sah.saurab...@gmail.com wrote: I sincerely thank this group as i got selected in Microsoft IDC only because of this group . It was a wonderful experience for me at the interviews because the some of questions were closely related to the questions discussed here . And i also got to know about book Crackin the Coding Interviews which is more than sufficient for any company interviews from this group only . Finally i thank all those group members who shared their experiences and others who replied to their queries . GOOD LUCK to all Saurabh Sah Final Year, B.Tech MNIT JAIPUR -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Kumar Raja M.Tech(SIT) IIT Kharagpur, 10it60...@iitkgp.ac.in 7797137043. 09491690115. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] MICROSOFT IDC
congrats dude On Thu, Sep 22, 2011 at 12:46 PM, Suraj Fale surajfa...@gmail.com wrote: Congrats !!!1 -- Regards Suraj Fale +91-9766103115 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: question
@Ratan: i think the next largest here would be 784559 On Thu, Sep 22, 2011 at 12:39 PM, Ratan success.rata...@gmail.com wrote: @kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no 439877238932[6]{987[3]} now sort in decreasing order 439877238932[6]{3789} this is the required no correct me if any thing wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ratan Kumar B. Tech 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. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: informatica pattern and question of interview
for interview ques 1 .. fink ak 's position using normal binary search in original list ..log n postion of a1 in corrupted list is n-k+1 .. O(1) eg : original : 0 1 2 3 4 corrupted : 3 4 0 1 2 n=5, k=3 , hence the ans 2...correct me if m wrong @ anup .. can u explain solution through modified binary search ?? On Sep 14, 6:44 pm, abhinav gupta guptaabhinav...@gmail.com wrote: Informatica sucks.I have topped in its offcampus written test still they din call me. On Wed, Sep 14, 2011 at 7:05 PM, ravi maggon maggonr...@gmail.com wrote: In Thapar Criteria was BE CSE and I think MCA was also eligible but for interviews only BE CSE were shortlisted. Package: 7.75 lpa On Wed, Sep 14, 2011 at 6:56 PM, sush57 sushaant...@gmail.com wrote: many i know what's the criteria and package for the company... regards sushaanth BE-computer science Madras Institute of technology On Sep 14, 3:02 pm, Ankit Agarwal ankuagarw...@gmail.com wrote: 2 question numbers are (a1+1)*a2*a3... an = a1*a2*a3...an + a2*a3...an the first term is same... for second term is (a1*a2...an)/(a1) now we have to find max of ( ((a1*a2..an)/a1), (a1*a2...an)/a2) so the question of max becomes min of( a1, a2, a3... an) -- Ankit Agarwal Computer Science Engg. Integrated Dual Degree, V yr Department of Electronics Computer Engineering Indian Institute of Technology Roorkee Ph. no. +91-9580098805 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Ravi Maggon B.E. CSE, Final Year Thapar University www.algorithmguru.com *Failure is the opportunity to begin again more intelligently* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- @ |3 # ! /\/ @ \./ -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] easy c output....
thanx Balaji:) On Thu, Sep 22, 2011 at 6:07 AM, Balaji balaji.subraman...@gmail.comwrote: Hi Anil, #a is a preprocessor operator to convert the argument specified as string or enclosing in double quotes. so, after macro expansion, the printf statement would become printf(%d\n,*432); = printf(%d\n,432[0]);= printf(%d\n,*4); which prints the ASCII equivalent 52. Similarly, using printf(%d\n, 432[1]),printf(%d\n, 432[2]) would yield 52 and 51 respectively. Let me know. Thanks, Balaji On Wed, Sep 21, 2011 at 4:34 PM, Anil Arya anilarya...@gmail.com wrote: #includestdio.h #define power(a) #a int main(){printf(%d\n,*power(432));return 0;} why it is giving 52 as output? -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: question
@dheeraj ... ya u r ryt thnxs for the correction On Thu, Sep 22, 2011 at 1:30 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: @Ratan: i think the next largest here would be 784559 On Thu, Sep 22, 2011 at 12:39 PM, Ratan success.rata...@gmail.com wrote: @kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no 439877238932[6]{987[3]} now sort in decreasing order 439877238932[6]{3789} this is the required no correct me if any thing wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ratan Kumar B. Tech 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. -- Dheeraj Sharma Comp Engg. NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ratan Kumar B. Tech MNNIT, Allahabad -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: question
#includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k; } swap(str[min],str[l],t); } } coutstr; getch(); } correct me..if m wrong.. On Thu, Sep 22, 2011 at 2:01 PM, Ratan success.rata...@gmail.com wrote: @dheeraj ... ya u r ryt thnxs for the correction On Thu, Sep 22, 2011 at 1:30 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: @Ratan: i think the next largest here would be 784559 On Thu, Sep 22, 2011 at 12:39 PM, Ratan success.rata...@gmail.com wrote: @kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no 439877238932[6]{987[3]} now sort in decreasing order 439877238932[6]{3789} this is the required no correct me if any thing wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ratan Kumar B. Tech 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. -- Dheeraj Sharma Comp Engg. NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ratan Kumar B. Tech 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. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] help nedded
for 2nd one #includeiostream #includeconio.h using namespace std; int main() { char str[100]; cinstr; char ch=str[0]; int count=0,i=0; while(str[i]) { if(str[i]==ch) count++; else { coutchcount; ch=str[i]; count=1; } i++; } coutchcount; getch(); } On Thu, Sep 22, 2011 at 11:58 AM, rahul sharma rahul23111...@gmail.comwrote: i found a question of ms earlier but know i not able to find it.plz post link or thread i/p::a3b2c4: o/p:aaabb i/p:aaabbc o/p:a3b2c1 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] help nedded
for 1st #includeiostream #includeconio.h #includestring.h using namespace std; int main() { char str[100]; cinstr; int len=strlen(str); int i=1; while(ilen) { int x=str[i]-48; while(x--) coutstr[i-1]; i+=2; } getch(); } On Thu, Sep 22, 2011 at 3:42 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: for 2nd one #includeiostream #includeconio.h using namespace std; int main() { char str[100]; cinstr; char ch=str[0]; int count=0,i=0; while(str[i]) { if(str[i]==ch) count++; else { coutchcount; ch=str[i]; count=1; } i++; } coutchcount; getch(); } On Thu, Sep 22, 2011 at 11:58 AM, rahul sharma rahul23111...@gmail.comwrote: i found a question of ms earlier but know i not able to find it.plz post link or thread i/p::a3b2c4: o/p:aaabb i/p:aaabbc o/p:a3b2c1 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: question
@ratan suggest some efficient algo... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: question
in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k; } swap(str[min],str[l],t); } } coutstr; getch(); } correct me..if m wrong.. On Thu, Sep 22, 2011 at 2:01 PM, Ratan success.rata...@gmail.com wrote: @dheeraj ... ya u r ryt thnxs for the correction On Thu, Sep 22, 2011 at 1:30 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: @Ratan: i think the next largest here would be 784559 On Thu, Sep 22, 2011 at 12:39 PM, Ratan success.rata...@gmail.com wrote: @kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no 439877238932[6]{987[3]} now sort in decreasing order 439877238932[6]{3789} this is the required no correct me if any thing wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ratan Kumar B. Tech 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. -- Dheeraj Sharma Comp Engg. NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ratan Kumar B. Tech 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. -- *Dheeraj Sharma* Comp Engg. NIT
Re: [algogeeks] Re: question
Keep a pointer ont the rightmost digit. Keep moving right until you find the number in increasing number. As soon as this breaks. stop. Swap the digit at the current position with the smallest digit, but larger than the current position digit, sort the array to the right of the current position in descending order. explanation: NUMBER:759854 INDEX: 012356 Keep the pointer at index 6. Keep moving right as long as numbers are in increasing fashion. Stop at index 1. swap this digit with the smallest digit larger than 5 i.e. 8 78(9554) now sort the array in parenthesis in descending order ans : 784559 For the implementation you can actually create an array of length 10, to keep track of all the digits encounters while moving left. This will help in sorting as well (similar to counting sort). One pass will do the work. You can print the answer directly afterwards. With Regards Unknown On Thu, Sep 22, 2011 at 4:13 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k; } swap(str[min],str[l],t); } } coutstr; getch(); } correct me..if m wrong.. On Thu, Sep 22, 2011 at 2:01 PM, Ratan success.rata...@gmail.com wrote: @dheeraj ... ya u r ryt thnxs for the correction On Thu, Sep 22, 2011 at 1:30 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: @Ratan: i think the next largest here would be 784559 On Thu, Sep 22, 2011 at 12:39 PM, Ratan success.rata...@gmail.com wrote: @kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no 439877238932[6]{987[3]} now sort in decreasing order 439877238932[6]{3789} this is the required no correct me if any thing wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ratan Kumar B. Tech 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
Re: [algogeeks] Re: question
@deeraj : for i/p 7585 u'r code is giving 7855 .. On Thu, Sep 22, 2011 at 6:54 AM, algo geek geeka...@gmail.com wrote: Keep a pointer ont the rightmost digit. Keep moving right until you find the number in increasing number. As soon as this breaks. stop. Swap the digit at the current position with the smallest digit, but larger than the current position digit, sort the array to the right of the current position in descending order. explanation: NUMBER:759854 INDEX: 012356 Keep the pointer at index 6. Keep moving right as long as numbers are in increasing fashion. Stop at index 1. swap this digit with the smallest digit larger than 5 i.e. 8 78(9554) now sort the array in parenthesis in descending order ans : 784559 For the implementation you can actually create an array of length 10, to keep track of all the digits encounters while moving left. This will help in sorting as well (similar to counting sort). One pass will do the work. You can print the answer directly afterwards. With Regards Unknown On Thu, Sep 22, 2011 at 4:13 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k; } swap(str[min],str[l],t); } } coutstr; getch(); } correct me..if m wrong.. On Thu, Sep 22, 2011 at 2:01 PM, Ratan success.rata...@gmail.comwrote: @dheeraj ... ya u r ryt thnxs for the correction On Thu, Sep 22, 2011 at 1:30 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: @Ratan: i think the next largest here would be 784559 On Thu, Sep 22, 2011 at 12:39 PM, Ratan success.rata...@gmail.com wrote: @kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no 439877238932[6]{987[3]} now sort in decreasing order 439877238932[6]{3789} this is the required no correct me if any thing wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Ratan Kumar B. Tech MNNIT, Allahabad -- You received this
Re: [algogeeks] Re: question
@algo geek: there is some error in your logic... consider a number 759845 according to ur logic the number greater than this will be 784559 but it should be 759854 . On Thu, Sep 22, 2011 at 4:24 PM, algo geek geeka...@gmail.com wrote: Keep a pointer ont the rightmost digit. Keep moving right until you find the number in increasing number. As soon as this breaks. stop. Swap the digit at the current position with the smallest digit, but larger than the current position digit, sort the array to the right of the current position in descending order. explanation: NUMBER:759854 INDEX: 012356 Keep the pointer at index 6. Keep moving right as long as numbers are in increasing fashion. Stop at index 1. swap this digit with the smallest digit larger than 5 i.e. 8 78(9554) now sort the array in parenthesis in descending order ans : 784559 For the implementation you can actually create an array of length 10, to keep track of all the digits encounters while moving left. This will help in sorting as well (similar to counting sort). One pass will do the work. You can print the answer directly afterwards. With Regards Unknown On Thu, Sep 22, 2011 at 4:13 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k; } swap(str[min],str[l],t); } } coutstr; getch(); } correct me..if m wrong.. On Thu, Sep 22, 2011 at 2:01 PM, Ratan success.rata...@gmail.comwrote: @dheeraj ... ya u r ryt thnxs for the correction On Thu, Sep 22, 2011 at 1:30 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: @Ratan: i think the next largest here would be 784559 On Thu, Sep 22, 2011 at 12:39 PM, Ratan success.rata...@gmail.com wrote: @kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no 439877238932[6]{987[3]} now sort in decreasing order 439877238932[6]{3789} this is the required no correct me if any thing wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at
Re: [algogeeks] Re: question
the following pseudocode may work: for(i=l;i=0;i--) { if(a[i-1]a[i]) { swap(a[i-1],a[i]); sort(a,i,l); swap(a[i-1],a[l]); break; } } here sort is a function that sort the array from index i to l. On Thu, Sep 22, 2011 at 4:38 PM, bharatkumar bagana bagana.bharatku...@gmail.com wrote: @deeraj : for i/p 7585 u'r code is giving 7855 .. On Thu, Sep 22, 2011 at 6:54 AM, algo geek geeka...@gmail.com wrote: Keep a pointer ont the rightmost digit. Keep moving right until you find the number in increasing number. As soon as this breaks. stop. Swap the digit at the current position with the smallest digit, but larger than the current position digit, sort the array to the right of the current position in descending order. explanation: NUMBER:759854 INDEX: 012356 Keep the pointer at index 6. Keep moving right as long as numbers are in increasing fashion. Stop at index 1. swap this digit with the smallest digit larger than 5 i.e. 8 78(9554) now sort the array in parenthesis in descending order ans : 784559 For the implementation you can actually create an array of length 10, to keep track of all the digits encounters while moving left. This will help in sorting as well (similar to counting sort). One pass will do the work. You can print the answer directly afterwards. With Regards Unknown On Thu, Sep 22, 2011 at 4:13 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k; } swap(str[min],str[l],t); } } coutstr; getch(); } correct me..if m wrong.. On Thu, Sep 22, 2011 at 2:01 PM, Ratan success.rata...@gmail.com wrote: @dheeraj ... ya u r ryt thnxs for the correction On Thu, Sep 22, 2011 at 1:30 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: @Ratan: i think the next largest here would be 784559 On Thu, Sep 22, 2011 at 12:39 PM, Ratan success.rata...@gmail.com wrote: @kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no 439877238932[6]{987[3]} now sort in decreasing order 439877238932[6]{3789} this is the required no correct me if any thing wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks
Re: [algogeeks] Re: Microsoft Question
@kartik: i thnk u r searching for string...that may have characters..in the 2d matrix ..NO MATTER WHERE THEY ARE.. On Wed, Sep 21, 2011 at 7:10 PM, kartik sachan kartik.sac...@gmail.comwrote: i think i can solve this in O(n^2) here is code http://ideone.com/Gk69A # includestdio.h# includestring.hchar a[100][100];int findword(int *b,int n,int m){ int i,j,flag=0; char s[1]; for(i=0;in;i++) for(j=0;jm;j++) s[a[i][j]]++; for(i=0;istrlen(b);i++) if(s[b[i]]!=0) s[b[i]]--; else {flag=0; break;} if(flag==0) return 0; else return 1;}int main(){ int i,j,n,m; char str[1]; scanf(%d %d,n,m); for(i=0;in;i++) for(j=0;jm;j++) scanf(%c,a[i][j]); scanf(%s,str); if(findword(str,n,m)) printf http://www.opengroup.org/onlinepubs/009695399/functions/printf.html(word is there in matrix); else printf http://www.opengroup.org/onlinepubs/009695399/functions/printf.html(word is not there in matrix);return 0;} plzz correct me if i am worng -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: question
my logic: if wrong then plz tell... start from rightmost digit and search towards left a digit less than this... if found ... just swap...u got the answer... if no small digit found then select second rightmost digit and follow the same process...and so on... for ex: 759354 rightmost digit =4 search for smaller digit than 4 towards left... it will be 3... then answer 759453 On Thu, Sep 22, 2011 at 4:40 PM, Yogesh Yadav medu...@gmail.com wrote: @algo geek: there is some error in your logic... consider a number 759845 according to ur logic the number greater than this will be 784559 but it should be 759854 . On Thu, Sep 22, 2011 at 4:24 PM, algo geek geeka...@gmail.com wrote: Keep a pointer ont the rightmost digit. Keep moving right until you find the number in increasing number. As soon as this breaks. stop. Swap the digit at the current position with the smallest digit, but larger than the current position digit, sort the array to the right of the current position in descending order. explanation: NUMBER:759854 INDEX: 012356 Keep the pointer at index 6. Keep moving right as long as numbers are in increasing fashion. Stop at index 1. swap this digit with the smallest digit larger than 5 i.e. 8 78(9554) now sort the array in parenthesis in descending order ans : 784559 For the implementation you can actually create an array of length 10, to keep track of all the digits encounters while moving left. This will help in sorting as well (similar to counting sort). One pass will do the work. You can print the answer directly afterwards. With Regards Unknown On Thu, Sep 22, 2011 at 4:13 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k; } swap(str[min],str[l],t); } } coutstr; getch(); } correct me..if m wrong.. On Thu, Sep 22, 2011 at 2:01 PM, Ratan success.rata...@gmail.comwrote: @dheeraj ... ya u r ryt thnxs for the correction On Thu, Sep 22, 2011 at 1:30 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: @Ratan: i think the next largest here would be 784559 On Thu, Sep 22, 2011 at 12:39 PM, Ratan success.rata...@gmail.com wrote: @kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no which is exchanged: Ex: 43987723893239876 first required sequence: 439877238932[3]987[6] swap these no
Re: [algogeeks] Re: tree to list
inorder traversal will do the job... just make sure to create links... On Thu, Sep 22, 2011 at 1:48 AM, Gene gene.ress...@gmail.com wrote: #include stdio.h typedef struct node_s { int data; struct node_s *left, *right; } NODE; // Convert BST to a sorted list connected by -right pointers. NODE *to_list(NODE *tree, NODE *tail) { if (tree == NULL) return tail; tree-right = to_list(tree-right, tail); return to_list(tree-left, tree); } void print_tree(NODE *tree) { if (tree == NULL) return; print_tree(tree-left); printf( %d, tree-data); print_tree(tree-right); } void print_list(NODE *list) { while (list) { printf( %d, list-data); list = list-right; } } int main(void) { NODE n1[] = {{ 1, NULL, NULL }}; NODE n3[] = {{ 3, NULL, NULL }}; NODE n5[] = {{ 5, NULL, NULL }}; NODE n2[] = {{ 2, n1, n3 }}; NODE n4[] = {{ 4, n2, n5 }}; NODE *tree = n4; NODE *list; printf(as tree:); print_tree(n4); printf(\n); list = to_list(n4, NULL); printf(as list:); print_list(list); printf(\n); return 0; } On Sep 21, 3:20 pm, prasanth n nprasnt...@gmail.com wrote: anyone give an algorithm of how to convert a binary search tree into a linkedlist -- *prasanth* -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: question
the answer should be 759435... On Thu, Sep 22, 2011 at 4:45 PM, Yogesh Yadav medu...@gmail.com wrote: my logic: if wrong then plz tell... start from rightmost digit and search towards left a digit less than this... if found ... just swap...u got the answer... if no small digit found then select second rightmost digit and follow the same process...and so on... for ex: 759354 rightmost digit =4 search for smaller digit than 4 towards left... it will be 3... then answer 759453 On Thu, Sep 22, 2011 at 4:40 PM, Yogesh Yadav medu...@gmail.com wrote: @algo geek: there is some error in your logic... consider a number 759845 according to ur logic the number greater than this will be 784559 but it should be 759854 . On Thu, Sep 22, 2011 at 4:24 PM, algo geek geeka...@gmail.com wrote: Keep a pointer ont the rightmost digit. Keep moving right until you find the number in increasing number. As soon as this breaks. stop. Swap the digit at the current position with the smallest digit, but larger than the current position digit, sort the array to the right of the current position in descending order. explanation: NUMBER:759854 INDEX: 012356 Keep the pointer at index 6. Keep moving right as long as numbers are in increasing fashion. Stop at index 1. swap this digit with the smallest digit larger than 5 i.e. 8 78(9554) now sort the array in parenthesis in descending order ans : 784559 For the implementation you can actually create an array of length 10, to keep track of all the digits encounters while moving left. This will help in sorting as well (similar to counting sort). One pass will do the work. You can print the answer directly afterwards. With Regards Unknown On Thu, Sep 22, 2011 at 4:13 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k; } swap(str[min],str[l],t); } } coutstr; getch(); } correct me..if m wrong.. On Thu, Sep 22, 2011 at 2:01 PM, Ratan success.rata...@gmail.com wrote: @dheeraj ... ya u r ryt thnxs for the correction On Thu, Sep 22, 2011 at 1:30 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: @Ratan: i think the next largest here would be 784559 On Thu, Sep 22, 2011 at 12:39 PM, Ratan success.rata...@gmail.com wrote: @kartik : to some extent ur code is giving the right answer... btw somehow check tis let for example the no be 759854 then the next biggest no is 794558 btw ur program is giving 795854 which is undoubtedly wrong the code would give more appropriate result if u sort the numbers from from i to n on meeting the condition of (a[i-1]a[i]) On Thu, Sep 22, 2011 at 11:53 AM, Ramakant Sharma ramakant...@gmail.com wrote: starting from right find first digit less then right most digit,if no any digit is less,then move to next right most and compair when found exchange those no, now sort the no.s up to that index of the given no
Re: [algogeeks] Re: question
@ratan: thanks for correction little correction in my logic... start from rightmost digit and search towards left a digit less than this... if found ... just swap...now after swapping save the index with which you are swapping ...and after that sort the array in ascending order...u got the answer... if no small digit found then select second rightmost digit and follow the same process...and so on... for ex: 759354 rightmost digit =4 search for smaller digit than 4 towards left... it will be 3... then 7594(53) now make the array in brackets in ascending order... answer 759435 now am i right?? On Thu, Sep 22, 2011 at 4:55 PM, Ratan success.rata...@gmail.com wrote: the answer should be 759435... On Thu, Sep 22, 2011 at 4:45 PM, Yogesh Yadav medu...@gmail.com wrote: my logic: if wrong then plz tell... start from rightmost digit and search towards left a digit less than this... if found ... just swap...u got the answer... if no small digit found then select second rightmost digit and follow the same process...and so on... for ex: 759354 rightmost digit =4 search for smaller digit than 4 towards left... it will be 3... then answer 759453 On Thu, Sep 22, 2011 at 4:40 PM, Yogesh Yadav medu...@gmail.com wrote: @algo geek: there is some error in your logic... consider a number 759845 according to ur logic the number greater than this will be 784559 but it should be 759854 . On Thu, Sep 22, 2011 at 4:24 PM, algo geek geeka...@gmail.com wrote: Keep a pointer ont the rightmost digit. Keep moving right until you find the number in increasing number. As soon as this breaks. stop. Swap the digit at the current position with the smallest digit, but larger than the current position digit, sort the array to the right of the current position in descending order. explanation: NUMBER:759854 INDEX: 012356 Keep the pointer at index 6. Keep moving right as long as numbers are in increasing fashion. Stop at index 1. swap this digit with the smallest digit larger than 5 i.e. 8 78(9554) now sort the array in parenthesis in descending order ans : 784559 For the implementation you can actually create an array of length 10, to keep track of all the digits encounters while moving left. This will help in sorting as well (similar to counting sort). One pass will do the work. You can print the answer directly afterwards. With Regards Unknown On Thu, Sep 22, 2011 at 4:13 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k; } swap(str[min],str[l],t); } } coutstr; getch(); } correct me..if m wrong.. On Thu, Sep 22, 2011 at 2:01 PM, Ratan success.rata...@gmail.com wrote: @dheeraj ... ya u r ryt thnxs for the correction On Thu, Sep 22, 2011 at
[algogeeks] Re: Function pointer
It can be used for Call back Functions --Mayuresh S. Gandhewar On Sep 22, 9:29 am, anshu mishra anshumishra6...@gmail.com wrote: as function object also -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
int main() { int a=256; char *p=a; *++p=2; printf(%d,a); 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] Re: question
@yogesh nice algo... it is not even required to sort the left out array, just reverse it :) On Thu, Sep 22, 2011 at 5:05 PM, Yogesh Yadav medu...@gmail.com wrote: @ratan: thanks for correction little correction in my logic... start from rightmost digit and search towards left a digit less than this... if found ... just swap...now after swapping save the index with which you are swapping ...and after that sort the array in ascending order...u got the answer... if no small digit found then select second rightmost digit and follow the same process...and so on... for ex: 759354 rightmost digit =4 search for smaller digit than 4 towards left... it will be 3... then 7594(53) now make the array in brackets in ascending order... answer 759435 now am i right?? On Thu, Sep 22, 2011 at 4:55 PM, Ratan success.rata...@gmail.com wrote: the answer should be 759435... On Thu, Sep 22, 2011 at 4:45 PM, Yogesh Yadav medu...@gmail.com wrote: my logic: if wrong then plz tell... start from rightmost digit and search towards left a digit less than this... if found ... just swap...u got the answer... if no small digit found then select second rightmost digit and follow the same process...and so on... for ex: 759354 rightmost digit =4 search for smaller digit than 4 towards left... it will be 3... then answer 759453 On Thu, Sep 22, 2011 at 4:40 PM, Yogesh Yadav medu...@gmail.com wrote: @algo geek: there is some error in your logic... consider a number 759845 according to ur logic the number greater than this will be 784559 but it should be 759854 . On Thu, Sep 22, 2011 at 4:24 PM, algo geek geeka...@gmail.com wrote: Keep a pointer ont the rightmost digit. Keep moving right until you find the number in increasing number. As soon as this breaks. stop. Swap the digit at the current position with the smallest digit, but larger than the current position digit, sort the array to the right of the current position in descending order. explanation: NUMBER:759854 INDEX: 012356 Keep the pointer at index 6. Keep moving right as long as numbers are in increasing fashion. Stop at index 1. swap this digit with the smallest digit larger than 5 i.e. 8 78(9554) now sort the array in parenthesis in descending order ans : 784559 For the implementation you can actually create an array of length 10, to keep track of all the digits encounters while moving left. This will help in sorting as well (similar to counting sort). One pass will do the work. You can print the answer directly afterwards. With Regards Unknown On Thu, Sep 22, 2011 at 4:13 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k; } swap(str[min],str[l],t); } } coutstr; getch(); }
Re: [algogeeks] Flip kart
around 11.5 LPA gross Regards, Adi Srikanth. Mob No 9887233349 Personal Pages: adisrikanth.co.nr On Thu, Sep 22, 2011 at 11:55 AM, rahul sharma rahul23111...@gmail.comwrote: wats eligibility n package? On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek sagarpar...@gmail.comwrote: nit allahabad On Thu, Sep 22, 2011 at 12:20 AM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: which college may i know? On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek sagarpar...@gmail.comwrote: it is coming in my college On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: How did u applied for it? Can you please let me know.. On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek sagarpar...@gmail.com wrote: Hello ... Do anyone know the process and questions of flip kart ?? -- **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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
Ans. 512 ... On Thu, Sep 22, 2011 at 5:38 PM, Rohit Upadhyaya mailtoroh...@gmail.comwrote: int main() { int a=256; char *p=a; *++p=2; printf(%d,a); 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]
suppose adress of a = 0x12; 0x12 has 0x13 has 0001 so p = 0x12; p++ = 0x13; now modifying the value pointed p by will modify the only 0x13 bcoz it is char type pointer and its value wiil be 0010 so finally 0x12 to 0x15 will have 512 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
512 Because: a will have the binary value of 256. a is an integer, so it will be stored over 4 bytes like this: a 0001 byte1 byte2 byte3 byte4 now a char pointer with point to one byte., and here the first byte. p \/ 0001 byte1 byte2 byte3 byte4 incrementing p will make it point to the second byte p \/ 0001 byte1 byte2 byte3 byte4 Assigning 2 to the value of p will change the data which is 0001 to 0010 (2 in binary) hence making: a 0010 byte1 byte2 byte3 byte4 which is binary for 512 On Thu, Sep 22, 2011 at 6:02 PM, Yogesh Yadav medu...@gmail.com wrote: Ans. 512 ... On Thu, Sep 22, 2011 at 5:38 PM, Rohit Upadhyaya mailtoroh...@gmail.comwrote: int main() { int a=256; char *p=a; *++p=2; printf(%d,a); 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. -- Anup Ghatage -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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]
isn't that simply because if little indian endian way of storing bytes in memory initial -- 0001 0.. finally-- 0010 0.. On Sep 22, 2011 5:38 PM, Rohit Upadhyaya mailtoroh...@gmail.com wrote: int main() { int a=256; char *p=a; *++p=2; printf(%d,a); 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.
[algogeeks] Re: THANX ALGOGEEKS !!!!!!
congrats dude hope u will be well connected with this group and help others to achieve their goals On Sep 22, 8:29 am, saurabh sah.saurab...@gmail.com wrote: I sincerely thank this group as i got selected in Microsoft IDC only because of this group . It was a wonderful experience for me at the interviews because the some of questions were closely related to the questions discussed here . And i also got to know about book Crackin the Coding Interviews which is more than sufficient for any company interviews from this group only . Finally i thank all those group members who shared their experiences and others who replied to their queries . GOOD LUCK to all Saurabh Sah Final Year, B.Tech MNIT JAIPUR -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] which is better?
n=n+1 n++ ++n which of the three is better ?? Sahil Garg Computer Engg. DCE -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] C OUTPUT
number will be sored in 2'scomplement form .as 4=100 so its 1's comlement form will be 011 and adding 1 to it will result in 011+1=100.so -4 will be printed On Wed, Sep 21, 2011 at 10:23 AM, kartik sachan kartik.sac...@gmail.comwrote: @ravi i think ur concepts is correct the no is stored in 2's formif negative thanks ravi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: THANX ALGOGEEKS !!!!!!
Congrats buddy. Can you please post the interview questions here. It helps. Thanks, Mani On Thu, Sep 22, 2011 at 6:22 PM, abhishek abhishek.ma...@gmail.com wrote: congrats dude hope u will be well connected with this group and help others to achieve their goals On Sep 22, 8:29 am, saurabh sah.saurab...@gmail.com wrote: I sincerely thank this group as i got selected in Microsoft IDC only because of this group . It was a wonderful experience for me at the interviews because the some of questions were closely related to the questions discussed here . And i also got to know about book Crackin the Coding Interviews which is more than sufficient for any company interviews from this group only . Finally i thank all those group members who shared their experiences and others who replied to their queries . GOOD LUCK to all Saurabh Sah Final Year, B.Tech MNIT JAIPUR -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanks Regards, Mani http://www.sanidapa.com - The music Search engine -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Paypal Interview questions
hey.. plz post your experience?? Sahil Garg Computer Engg. DCE On Wed, Aug 3, 2011 at 11:54 PM, Deepak deepakthegi...@gmail.com wrote: Can anyone pls post Paypal written questions and important subjects or topics to prepare for written as well as for tech interview?? Thanks in advance... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Paypal
hey plz post ur experience?? Sahil Garg Computer Engg. DCE On Mon, Aug 8, 2011 at 8:43 PM, siva viknesh sivavikne...@gmail.com wrote: not sure i m also gonna attend wit u only if u r from anna univ :P On Aug 6, 7:44 pm, swetha rahul swetharahu...@gmail.com wrote: Thanks Siva... Is it all MCQ or they ask us to code for a problem..?? On Sat, Aug 6, 2011 at 7:35 PM, siva viknesh sivavikne...@gmail.com wrote: Paypal is a subsidiary of ebay .. so i think mostly java .. SCJP level !! On Aug 6, 6:52 pm, swetha rahul swetharahu...@gmail.com wrote: Hi, Can anybody say what is the wriiten test pattern of paypal... :-) What kind of questions are asked ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] which is better?
prefix operator is better.the compiler does not have to maintain the copy of the variable as in the postfix operator .. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: THANX ALGOGEEKS !!!!!!
thanx to all I have shared my interview experience at http://msidcinterview.blogspot.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] Re: MICROSOFT IDC
thanx to all @sanjay I have shared my interview experience at http://msidcinterview.blogspot.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] Re: question
@bharat...so i thnk 7585 shud hav 7855 as ans..!! On Thu, Sep 22, 2011 at 5:42 PM, Arpit Sood soodfi...@gmail.com wrote: @yogesh nice algo... it is not even required to sort the left out array, just reverse it :) On Thu, Sep 22, 2011 at 5:05 PM, Yogesh Yadav medu...@gmail.com wrote: @ratan: thanks for correction little correction in my logic... start from rightmost digit and search towards left a digit less than this... if found ... just swap...now after swapping save the index with which you are swapping ...and after that sort the array in ascending order...u got the answer... if no small digit found then select second rightmost digit and follow the same process...and so on... for ex: 759354 rightmost digit =4 search for smaller digit than 4 towards left... it will be 3... then 7594(53) now make the array in brackets in ascending order... answer 759435 now am i right?? On Thu, Sep 22, 2011 at 4:55 PM, Ratan success.rata...@gmail.com wrote: the answer should be 759435... On Thu, Sep 22, 2011 at 4:45 PM, Yogesh Yadav medu...@gmail.com wrote: my logic: if wrong then plz tell... start from rightmost digit and search towards left a digit less than this... if found ... just swap...u got the answer... if no small digit found then select second rightmost digit and follow the same process...and so on... for ex: 759354 rightmost digit =4 search for smaller digit than 4 towards left... it will be 3... then answer 759453 On Thu, Sep 22, 2011 at 4:40 PM, Yogesh Yadav medu...@gmail.com wrote: @algo geek: there is some error in your logic... consider a number 759845 according to ur logic the number greater than this will be 784559 but it should be 759854 . On Thu, Sep 22, 2011 at 4:24 PM, algo geek geeka...@gmail.com wrote: Keep a pointer ont the rightmost digit. Keep moving right until you find the number in increasing number. As soon as this breaks. stop. Swap the digit at the current position with the smallest digit, but larger than the current position digit, sort the array to the right of the current position in descending order. explanation: NUMBER:759854 INDEX: 012356 Keep the pointer at index 6. Keep moving right as long as numbers are in increasing fashion. Stop at index 1. swap this digit with the smallest digit larger than 5 i.e. 8 78(9554) now sort the array in parenthesis in descending order ans : 784559 For the implementation you can actually create an array of length 10, to keep track of all the digits encounters while moving left. This will help in sorting as well (similar to counting sort). One pass will do the work. You can print the answer directly afterwards. With Regards Unknown On Thu, Sep 22, 2011 at 4:13 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l; for(int k=l+1;klen;k++) { if(str[k]str[min]) min=k;
Re: [algogeeks] Re: Microsoft Question
@dheeraj i didn't get what u want to say explain me with the help of example -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: MICROSOFT IDC
Saurabh : Thank u very much :) Sanju :) On Thu, Sep 22, 2011 at 6:15 AM, saurabh sah.saurab...@gmail.com wrote: thanx to all @sanjay I have shared my interview experience at http://msidcinterview.blogspot.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] Re: which is better?
No modern compiler will see these as different. Use the one you find prettiest. On Sep 22, 8:54 am, Sahil Garg garg.sahi...@gmail.com wrote: n=n+1 n++ ++n which of the three is better ?? Sahil Garg Computer Engg. DCE -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: which is better?
If the value of the expression is not being used, ++n is preferred. Most coding standards used by big companies require the prefix operator to be used unless the pre-incremented value is required. Don On Sep 22, 7:54 am, Sahil Garg garg.sahi...@gmail.com wrote: n=n+1 n++ ++n which of the three is better ?? Sahil Garg Computer Engg. DCE -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Flip kart
12.5 On Thu, Sep 22, 2011 at 5:49 PM, Adi Srikanth adisriika...@gmail.comwrote: around 11.5 LPA gross Regards, Adi Srikanth. Mob No 9887233349 Personal Pages: adisrikanth.co.nr On Thu, Sep 22, 2011 at 11:55 AM, rahul sharma rahul23111...@gmail.comwrote: wats eligibility n package? On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek sagarpar...@gmail.comwrote: nit allahabad On Thu, Sep 22, 2011 at 12:20 AM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: which college may i know? On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek sagarpar...@gmail.comwrote: it is coming in my college On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: How did u applied for it? Can you please let me know.. On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek sagarpar...@gmail.com wrote: Hello ... Do anyone know the process and questions of flip kart ?? -- **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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] easy c output....
@balaji +1 :) On Thu, Sep 22, 2011 at 2:01 PM, Anil Arya anilarya...@gmail.com wrote: thanx Balaji:) On Thu, Sep 22, 2011 at 6:07 AM, Balaji balaji.subraman...@gmail.comwrote: Hi Anil, #a is a preprocessor operator to convert the argument specified as string or enclosing in double quotes. so, after macro expansion, the printf statement would become printf(%d\n,*432); = printf(%d\n,432[0]);= printf(%d\n,*4); which prints the ASCII equivalent 52. Similarly, using printf(%d\n, 432[1]),printf(%d\n, 432[2]) would yield 52 and 51 respectively. Let me know. Thanks, Balaji On Wed, Sep 21, 2011 at 4:34 PM, Anil Arya anilarya...@gmail.com wrote: #includestdio.h #define power(a) #a int main(){printf(%d\n,*power(432));return 0;} why it is giving 52 as output? -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- AMRIT -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 for Pep Exam
Can anyone tell me some suggestions to prepare for Pep exam...? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: which is better?
Depends on compiler architecture , and how they use instruction set architecture ( Increment Op) of underlining machine On Thu, Sep 22, 2011 at 7:21 AM, Don dondod...@gmail.com wrote: If the value of the expression is not being used, ++n is preferred. Most coding standards used by big companies require the prefix operator to be used unless the pre-incremented value is required. Don On Sep 22, 7:54 am, Sahil Garg garg.sahi...@gmail.com wrote: n=n+1 n++ ++n which of the three is better ?? Sahil Garg Computer Engg. DCE -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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, -- **DIPANKAR DUTTA Software Development Engineer Xen Server - OpenStack Development Team (DataCenter and Cloud) Citrix RD India Pvt Ltd 69/3, Millers Road, Bangalore – 560052 Phone: +91 8147830733 Office: Extn: 16429 Email: dipankar.du...@citrix.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] Re: which is better?
depends on the requirement of the code... On Thu, Sep 22, 2011 at 11:00 AM, DIPANKAR DUTTA dutta.dipanka...@gmail.com wrote: Depends on compiler architecture , and how they use instruction set architecture ( Increment Op) of underlining machine On Thu, Sep 22, 2011 at 7:21 AM, Don dondod...@gmail.com wrote: If the value of the expression is not being used, ++n is preferred. Most coding standards used by big companies require the prefix operator to be used unless the pre-incremented value is required. Don On Sep 22, 7:54 am, Sahil Garg garg.sahi...@gmail.com wrote: n=n+1 n++ ++n which of the three is better ?? Sahil Garg Computer Engg. DCE -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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, -- **DIPANKAR DUTTA Software Development Engineer Xen Server - OpenStack Development Team (DataCenter and Cloud) Citrix RD India Pvt Ltd 69/3, Millers Road, Bangalore – 560052 Phone: +91 8147830733 Office: Extn: 16429 Email: dipankar.du...@citrix.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] easy c output....
awesome :) On Thu, Sep 22, 2011 at 7:55 PM, amrit harry dabbcomput...@gmail.comwrote: @balaji +1 :) On Thu, Sep 22, 2011 at 2:01 PM, Anil Arya anilarya...@gmail.com wrote: thanx Balaji:) On Thu, Sep 22, 2011 at 6:07 AM, Balaji balaji.subraman...@gmail.comwrote: Hi Anil, #a is a preprocessor operator to convert the argument specified as string or enclosing in double quotes. so, after macro expansion, the printf statement would become printf(%d\n,*432); = printf(%d\n,432[0]);= printf(%d\n,*4); which prints the ASCII equivalent 52. Similarly, using printf(%d\n, 432[1]),printf(%d\n, 432[2]) would yield 52 and 51 respectively. Let me know. Thanks, Balaji On Wed, Sep 21, 2011 at 4:34 PM, Anil Arya anilarya...@gmail.comwrote: #includestdio.h #define power(a) #a int main(){printf(%d\n,*power(432));return 0;} why it is giving 52 as output? -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- AMRIT -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] error in c++ program
how we can remove error ? #includeiostream using namespace std; class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display(); }; void time::set(int x,int y) { m=x; h=y; } void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h; } void time::display(void) { coutminute==mendl; couthours==hendl; } int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); } 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] Re: error in c++ program
Give us some help. What is the error? Syntax error? Logic error? Runtime error? On Sep 22, 10:47 am, Rajesh Kumar testalgori...@gmail.com wrote: how we can remove error ? #includeiostream using namespace std; class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display();}; void time::set(int x,int y) { m=x; h=y;} void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h;} void time::display(void) { coutminute==mendl; couthours==hendl;} int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); } 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] Re: error in c++ program
#includeiostream.h class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display(); }; void time::set(int x,int y) { m=x; h=y; } void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h; } void time::display(void) { coutminute==mendl; couthours==hendl; } int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); return 0; } dis does works...chk it out!!! Regards, PAYAL GUPTA, CSE-3rd yr, NIT_B On Thu, Sep 22, 2011 at 9:28 PM, Don dondod...@gmail.com wrote: Give us some help. What is the error? Syntax error? Logic error? Runtime error? On Sep 22, 10:47 am, Rajesh Kumar testalgori...@gmail.com wrote: how we can remove error ? #includeiostream using namespace std; class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display();}; void time::set(int x,int y) { m=x; h=y;} void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h;} void time::display(void) { coutminute==mendl; couthours==hendl;} int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); } 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: error in c++ program
not working by changes provide by you On Thu, Sep 22, 2011 at 9:42 PM, payal gupta gpt.pa...@gmail.com wrote: #includeiostream.h class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display(); }; void time::set(int x,int y) { m=x; h=y; } void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h; } void time::display(void) { coutminute==mendl; couthours==hendl; } int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); return 0; } dis does works...chk it out!!! Regards, PAYAL GUPTA, CSE-3rd yr, NIT_B On Thu, Sep 22, 2011 at 9:28 PM, Don dondod...@gmail.com wrote: Give us some help. What is the error? Syntax error? Logic error? Runtime error? On Sep 22, 10:47 am, Rajesh Kumar testalgori...@gmail.com wrote: how we can remove error ? #includeiostream using namespace std; class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display();}; void time::set(int x,int y) { m=x; h=y;} void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h;} void time::display(void) { coutminute==mendl; couthours==hendl;} int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); } 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Re: error in c++ program
plz help 4 me.. Is thr any1 knw how to write the code in trust calculation?... On Thu, Sep 22, 2011 at 9:57 PM, Rajesh Kumar testalgori...@gmail.comwrote: not working by changes provide by you On Thu, Sep 22, 2011 at 9:42 PM, payal gupta gpt.pa...@gmail.com wrote: #includeiostream.h class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display(); }; void time::set(int x,int y) { m=x; h=y; } void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h; } void time::display(void) { coutminute==mendl; couthours==hendl; } int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); return 0; } dis does works...chk it out!!! Regards, PAYAL GUPTA, CSE-3rd yr, NIT_B On Thu, Sep 22, 2011 at 9:28 PM, Don dondod...@gmail.com wrote: Give us some help. What is the error? Syntax error? Logic error? Runtime error? On Sep 22, 10:47 am, Rajesh Kumar testalgori...@gmail.com wrote: how we can remove error ? #includeiostream using namespace std; class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display();}; void time::set(int x,int y) { m=x; h=y;} void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h;} void time::display(void) { coutminute==mendl; couthours==hendl;} int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); } 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- with smile Nandy -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Paypal
Interview Questions and Experiences(Jeeva): This is the most easiest interview I’ve seen compared to microsoft,amazon,directi and morgan stanley. They’ve just asked basics in all. Technical interview 1: First he asked about the subjects I’m studying this semester(I couldn’t remenber all of them). Then he asked about projects (It is the only way to attract most of the interviewers. Be prepared with that). Then he asked about projects (It is the only way to express yourselves.Be prepared with all the projects).I explained my projects well .He got impressed with those things. Then he asked about the difference between c and c++. I’ve explained mostly a hgll(including its object oriented features, new operator,delete operator and so on).Then he asked abt how memory allocation is done in c. I’ve explained malloc, then told abt the difference between malloc and new.Then I told abt delete(c++) and free(c). Then he concentrated on OOPS. He asked about virtual function. why it is used. Its mechanism and everything related to that. Then he asked abt stack and heap. I told abt the memory allocation using that (Like global and static members are allocated in heap , and allocation of memory using pointers(in heap) and the pointer itself in stack, then local memory in stack) Then he asked about tree traversals.I’ve explained all the three and explained how it works using a recursion tree. Finally he asked about a puzzle. You are given two sand clocks one of 7 mins and other is of 11 mins to drain all sand particles. With that thing you have to calculate 15 mins. 1st Interview is over with that. Interview round 2: First he asked about shortest path problem . He asked me to write code for it.I wrote Bellman ford algorithm and explained it using a graph clearly. Then he asked me to write a sql query to find nth maximum element. I wrote using ‘limit’. Then he asked about OOPS like given three classes A,B,C and they are in multi level inheritance. He asked about the use of public,protected and private members of A in B and in C. Then he asked about the friend functions. Finally o SHARON: TECH 1: the interview was very easy and they stuck to the basics. I was asked about all the OOPS concepts like inheritance,polymorphism etc. He asked questions on virtual functions. He gave me a common puzzle. there are three boxes. one box of blue balls, one green and one mixed ,all labelled incorrectly. In how many trials will i label them correctly. There are 10 weights of which two weigh less than the others. using a balance how will i identify the defective ones. sql query on finding the nth maximum. code for deletion in linked lists. he asked about my projects and my extra-curricular activities. optimal way to find the nth maximum element using a DS TECH 2: He asked me about my favourite technologies,what i liked about facebook. Asked me to design a cinema ticket reservation web site - like the one satyam has. On Sep 22, 6:05 pm, Sahil Garg garg.sahi...@gmail.com wrote: hey plz post ur experience?? Sahil Garg Computer Engg. DCE On Mon, Aug 8, 2011 at 8:43 PM, siva viknesh sivavikne...@gmail.com wrote: not sure i m also gonna attend wit u only if u r from anna univ :P On Aug 6, 7:44 pm, swetha rahul swetharahu...@gmail.com wrote: Thanks Siva... Is it all MCQ or they ask us to code for a problem..?? On Sat, Aug 6, 2011 at 7:35 PM, siva viknesh sivavikne...@gmail.com wrote: Paypal is a subsidiary of ebay .. so i think mostly java .. SCJP level !! On Aug 6, 6:52 pm, swetha rahul swetharahu...@gmail.com wrote: Hi, Can anybody say what is the wriiten test pattern of paypal... :-) What kind of questions are asked ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] plz reply quickly
How will u detect if a queue is circular or not?? -- Kind Regards Ishan Aggarwal [image: Aricent Group] Presidency Tower-A, M.G.Road,Sector-14 Gurgaon,Haryana.122015 INDIA Phone : +91-9654602663 ishan2.aggar...@aricent.com puneet.ar...@aricent.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] Re: Paypal
first round was mixture of c , cpp , very few general aps and few subjective ques print semicolon without using semicolon anywhere in program 2 trains in opposite dir...wat time they ll meet... On Sep 22, 9:36 pm, siva viknesh sivavikne...@gmail.com wrote: Interview Questions and Experiences(Jeeva): This is the most easiest interview I’ve seen compared to microsoft,amazon,directi and morgan stanley. They’ve just asked basics in all. Technical interview 1: First he asked about the subjects I’m studying this semester(I couldn’t remenber all of them). Then he asked about projects (It is the only way to attract most of the interviewers. Be prepared with that). Then he asked about projects (It is the only way to express yourselves.Be prepared with all the projects).I explained my projects well .He got impressed with those things. Then he asked about the difference between c and c++. I’ve explained mostly a hgll(including its object oriented features, new operator,delete operator and so on).Then he asked abt how memory allocation is done in c. I’ve explained malloc, then told abt the difference between malloc and new.Then I told abt delete(c++) and free(c). Then he concentrated on OOPS. He asked about virtual function. why it is used. Its mechanism and everything related to that. Then he asked abt stack and heap. I told abt the memory allocation using that (Like global and static members are allocated in heap , and allocation of memory using pointers(in heap) and the pointer itself in stack, then local memory in stack) Then he asked about tree traversals.I’ve explained all the three and explained how it works using a recursion tree. Finally he asked about a puzzle. You are given two sand clocks one of 7 mins and other is of 11 mins to drain all sand particles. With that thing you have to calculate 15 mins. 1st Interview is over with that. Interview round 2: First he asked about shortest path problem . He asked me to write code for it.I wrote Bellman ford algorithm and explained it using a graph clearly. Then he asked me to write a sql query to find nth maximum element. I wrote using ‘limit’. Then he asked about OOPS like given three classes A,B,C and they are in multi level inheritance. He asked about the use of public,protected and private members of A in B and in C. Then he asked about the friend functions. Finally o SHARON: TECH 1: the interview was very easy and they stuck to the basics. I was asked about all the OOPS concepts like inheritance,polymorphism etc. He asked questions on virtual functions. He gave me a common puzzle. there are three boxes. one box of blue balls, one green and one mixed ,all labelled incorrectly. In how many trials will i label them correctly. There are 10 weights of which two weigh less than the others. using a balance how will i identify the defective ones. sql query on finding the nth maximum. code for deletion in linked lists. he asked about my projects and my extra-curricular activities. optimal way to find the nth maximum element using a DS TECH 2: He asked me about my favourite technologies,what i liked about facebook. Asked me to design a cinema ticket reservation web site - like the one satyam has. On Sep 22, 6:05 pm, Sahil Garg garg.sahi...@gmail.com wrote: hey plz post ur experience?? Sahil Garg Computer Engg. DCE On Mon, Aug 8, 2011 at 8:43 PM, siva viknesh sivavikne...@gmail.com wrote: not sure i m also gonna attend wit u only if u r from anna univ :P On Aug 6, 7:44 pm, swetha rahul swetharahu...@gmail.com wrote: Thanks Siva... Is it all MCQ or they ask us to code for a problem..?? On Sat, Aug 6, 2011 at 7:35 PM, siva viknesh sivavikne...@gmail.com wrote: Paypal is a subsidiary of ebay .. so i think mostly java .. SCJP level !! On Aug 6, 6:52 pm, swetha rahul swetharahu...@gmail.com wrote: Hi, Can anybody say what is the wriiten test pattern of paypal... :-) What kind of questions are asked ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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
Re: [algogeeks] plz reply quickly
queue represnted as array or linked list ? On Thu, Sep 22, 2011 at 10:08 PM, Ishan Aggarwal ishan.aggarwal.1...@gmail.com wrote: How will u detect if a queue is circular or not?? -- Kind Regards Ishan Aggarwal [image: Aricent Group] Presidency Tower-A, M.G.Road,Sector-14 Gurgaon,Haryana.122015 INDIA Phone : +91-9654602663 ishan2.aggar...@aricent.com puneet.ar...@aricent.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] plz reply quickly
In both the cases... what would be the condition? On Thu, Sep 22, 2011 at 10:19 PM, sukran dhawan sukrandha...@gmail.comwrote: queue represnted as array or linked list ? On Thu, Sep 22, 2011 at 10:08 PM, Ishan Aggarwal ishan.aggarwal.1...@gmail.com wrote: How will u detect if a queue is circular or not?? -- Kind Regards Ishan Aggarwal [image: Aricent Group] Presidency Tower-A, M.G.Road,Sector-14 Gurgaon,Haryana.122015 INDIA Phone : +91-9654602663 ishan2.aggar...@aricent.com puneet.ar...@aricent.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. -- Kind Regards Ishan Aggarwal [image: Aricent Group] Presidency Tower-A, M.G.Road,Sector-14 Gurgaon,Haryana.122015 INDIA Phone : +91-9654602663 ishan2.aggar...@aricent.com puneet.ar...@aricent.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] plz help
got 45 on linux than tried with fflush(stdout) and got 9 which is correct . so I guess that both child and parent process getting the same buffer and thus resulting in more number of hello correct answer is 9 as already mentioned On Sep 21, 2011 7:57 PM, sush57 sushaant...@gmail.com wrote: main() { int tmp; for(i=0;i9;i++) { tmp=fork(); if(tmp0) break; printf(Hello); } } what's the output and how does this work can u give few other questions using fork... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Doubts about realloc
Hi I have a doubt in functioning of realloc. Can we use realloc to shrink the memory already allocated ? If yes, will it also free the left over memory or programmer has to do it ? Also, while reallocating if it has to move to some other location does the earlier location gets freed or is it implementation dependent Thanks Ankuj -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: THANX ALGOGEEKS !!!!!!
congrats brother!! On Thu, Sep 22, 2011 at 6:42 PM, saurabh sah.saurab...@gmail.com wrote: thanx to all I have shared my interview experience at http://msidcinterview.blogspot.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] plz reply quickly
use hair and tortoise rule for lists i don think we can do it for arrays On Thu, Sep 22, 2011 at 10:22 PM, Ishan Aggarwal ishan.aggarwal.1...@gmail.com wrote: In both the cases... what would be the condition? On Thu, Sep 22, 2011 at 10:19 PM, sukran dhawan sukrandha...@gmail.comwrote: queue represnted as array or linked list ? On Thu, Sep 22, 2011 at 10:08 PM, Ishan Aggarwal ishan.aggarwal.1...@gmail.com wrote: How will u detect if a queue is circular or not?? -- Kind Regards Ishan Aggarwal [image: Aricent Group] Presidency Tower-A, M.G.Road,Sector-14 Gurgaon,Haryana.122015 INDIA Phone : +91-9654602663 ishan2.aggar...@aricent.com puneet.ar...@aricent.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. -- Kind Regards Ishan Aggarwal [image: Aricent Group] Presidency Tower-A, M.G.Road,Sector-14 Gurgaon,Haryana.122015 INDIA Phone : +91-9654602663 ishan2.aggar...@aricent.com puneet.ar...@aricent.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] Re: THANX ALGOGEEKS !!!!!!
congrats On Thu, Sep 22, 2011 at 10:33 PM, Prakash D cegprak...@gmail.com wrote: congrats brother!! On Thu, Sep 22, 2011 at 6:42 PM, saurabh sah.saurab...@gmail.com wrote: thanx to all I have shared my interview experience at http://msidcinterview.blogspot.com/ ta -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: error in c++ program
time is a keyword in c/cpp, change time to any other string in ur code nd it will work. On Thu, Sep 22, 2011 at 12:27 PM, Rajesh Kumar testalgori...@gmail.comwrote: not working by changes provide by you On Thu, Sep 22, 2011 at 9:42 PM, payal gupta gpt.pa...@gmail.com wrote: #includeiostream.h class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display(); }; void time::set(int x,int y) { m=x; h=y; } void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h; } void time::display(void) { coutminute==mendl; couthours==hendl; } int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); return 0; } dis does works...chk it out!!! Regards, PAYAL GUPTA, CSE-3rd yr, NIT_B On Thu, Sep 22, 2011 at 9:28 PM, Don dondod...@gmail.com wrote: Give us some help. What is the error? Syntax error? Logic error? Runtime error? On Sep 22, 10:47 am, Rajesh Kumar testalgori...@gmail.com wrote: how we can remove error ? #includeiostream using namespace std; class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display();}; void time::set(int x,int y) { m=x; h=y;} void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h;} void time::display(void) { coutminute==mendl; couthours==hendl;} int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); } 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Doubts about realloc
Realloc will resize a block of memory larger or smaller. If it requires that the block be moved, it will copy the contents of the old memory into the new location and free the old memory. Don On Sep 22, 12:01 pm, Ankuj Gupta ankuj2...@gmail.com wrote: Hi I have a doubt in functioning of realloc. Can we use realloc to shrink the memory already allocated ? If yes, will it also free the left over memory or programmer has to do it ? Also, while reallocating if it has to move to some other location does the earlier location gets freed or is it implementation dependent Thanks Ankuj -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: error in c++ program
@rahul +1 On Thu, Sep 22, 2011 at 11:20 PM, rahul vatsa vatsa.ra...@gmail.com wrote: time is a keyword in c/cpp, change time to any other string in ur code nd it will work. On Thu, Sep 22, 2011 at 12:27 PM, Rajesh Kumar testalgori...@gmail.comwrote: not working by changes provide by you On Thu, Sep 22, 2011 at 9:42 PM, payal gupta gpt.pa...@gmail.com wrote: #includeiostream.h class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display(); }; void time::set(int x,int y) { m=x; h=y; } void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h; } void time::display(void) { coutminute==mendl; couthours==hendl; } int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); return 0; } dis does works...chk it out!!! Regards, PAYAL GUPTA, CSE-3rd yr, NIT_B On Thu, Sep 22, 2011 at 9:28 PM, Don dondod...@gmail.com wrote: Give us some help. What is the error? Syntax error? Logic error? Runtime error? On Sep 22, 10:47 am, Rajesh Kumar testalgori...@gmail.com wrote: how we can remove error ? #includeiostream using namespace std; class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display();}; void time::set(int x,int y) { m=x; h=y;} void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h;} void time::display(void) { coutminute==mendl; couthours==hendl;} int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); } 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: error in c++ program
thanx Rahul On Thu, Sep 22, 2011 at 11:54 PM, abhinav gupta abhinav@gmail.comwrote: @rahul +1 On Thu, Sep 22, 2011 at 11:20 PM, rahul vatsa vatsa.ra...@gmail.comwrote: time is a keyword in c/cpp, change time to any other string in ur code nd it will work. On Thu, Sep 22, 2011 at 12:27 PM, Rajesh Kumar testalgori...@gmail.comwrote: not working by changes provide by you On Thu, Sep 22, 2011 at 9:42 PM, payal gupta gpt.pa...@gmail.comwrote: #includeiostream.h class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display(); }; void time::set(int x,int y) { m=x; h=y; } void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h; } void time::display(void) { coutminute==mendl; couthours==hendl; } int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); return 0; } dis does works...chk it out!!! Regards, PAYAL GUPTA, CSE-3rd yr, NIT_B On Thu, Sep 22, 2011 at 9:28 PM, Don dondod...@gmail.com wrote: Give us some help. What is the error? Syntax error? Logic error? Runtime error? On Sep 22, 10:47 am, Rajesh Kumar testalgori...@gmail.com wrote: how we can remove error ? #includeiostream using namespace std; class time { int m; int h; public: void set(int,int); void sum(time,time,time); void display();}; void time::set(int x,int y) { m=x; h=y;} void time::sum(time t1,time t2,time t3) { m=t1.m+t2.m+t3.m; h=t1.h+t2.h+t3.h;} void time::display(void) { coutminute==mendl; couthours==hendl;} int main() { time a,b,c,d; a.set(1,2); b.set(2,4); c.set(4,8); d.sum(a,b,c); //display a.display(); b.display(); c.display(); d.display(); } 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Re: informatica pattern and question of interview
eg : original : 0 1 2 3 4 corrupted : 3 4 0 1 2 this can be done as below.. compare the middle element with first and the last element.. if middle first chk for first half else chk for second half above eg. middle = 0 first = 3 last = 2 as 03 consider 3 4 0 middle = 4 first = 3 last = 0 as 43 consider 4 0 for 2 elements simply find the index of min element now u have the index of 0 in log(n). Sahil Garg Computer Engg. DCE On Thu, Sep 22, 2011 at 1:31 PM, siva viknesh sivavikne...@gmail.comwrote: eg : original : 0 1 2 3 4 corrupted : 3 4 0 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.
[algogeeks] Questions on Graphs
Hi Frnds Can anybody suggest me some questions typically asked on Graphs . Couldnt find much in the internet If some one can share link or few questions on Graphs it will be really helpful Thanks in Advance Ankur -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Permuations and Combinations
(1) What is the efficient approach to generate permutations of a given sequence of numbers (may contain duplicates) in lexicographic order e.g. i/p: 5,1,6,1 o/p: 1 1 5 6 1 1 6 5 1 5 1 6 1 5 6 1 1 6 1 5 1 6 5 1 5 1 1 6 5 1 6 1 5 6 1 1 6 1 1 5 6 1 5 1 6 5 1 1 what is the time complexity of ur approach?/ (2)What is the efficient approach to generate combinations of a given sequence of numbers (may contain duplicates) in lexicographic order e.g. i/p: {3,2 ,1,5,1,7} and k=2 (2-size subsets) o/p: 1 1 1 2 1 3 1 5 1 7 2 3 2 5 2 7 3 5 3 7 5 7 ( {5,7} is same as {7,5} because it is a selection). what is the time complexity of the algorithm?? -- Regards Kumar Raja M.Tech(SIT) IIT Kharagpur, 10it60...@iitkgp.ac.in 7797137043. 09491690115. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Paypal
thnx siva.. Sahil Garg Computer Engineering Delhi College of Engineering On Thu, Sep 22, 2011 at 10:10 PM, siva viknesh sivavikne...@gmail.comwrote: first round was mixture of c , cpp , very few general aps and few subjective ques print semicolon without using semicolon anywhere in program 2 trains in opposite dir...wat time they ll meet... On Sep 22, 9:36 pm, siva viknesh sivavikne...@gmail.com wrote: Interview Questions and Experiences(Jeeva): This is the most easiest interview I’ve seen compared to microsoft,amazon,directi and morgan stanley. They’ve just asked basics in all. Technical interview 1: First he asked about the subjects I’m studying this semester(I couldn’t remenber all of them). Then he asked about projects (It is the only way to attract most of the interviewers. Be prepared with that). Then he asked about projects (It is the only way to express yourselves.Be prepared with all the projects).I explained my projects well .He got impressed with those things. Then he asked about the difference between c and c++. I’ve explained mostly a hgll(including its object oriented features, new operator,delete operator and so on).Then he asked abt how memory allocation is done in c. I’ve explained malloc, then told abt the difference between malloc and new.Then I told abt delete(c++) and free(c). Then he concentrated on OOPS. He asked about virtual function. why it is used. Its mechanism and everything related to that. Then he asked abt stack and heap. I told abt the memory allocation using that (Like global and static members are allocated in heap , and allocation of memory using pointers(in heap) and the pointer itself in stack, then local memory in stack) Then he asked about tree traversals.I’ve explained all the three and explained how it works using a recursion tree. Finally he asked about a puzzle. You are given two sand clocks one of 7 mins and other is of 11 mins to drain all sand particles. With that thing you have to calculate 15 mins. 1st Interview is over with that. Interview round 2: First he asked about shortest path problem . He asked me to write code for it.I wrote Bellman ford algorithm and explained it using a graph clearly. Then he asked me to write a sql query to find nth maximum element. I wrote using ‘limit’. Then he asked about OOPS like given three classes A,B,C and they are in multi level inheritance. He asked about the use of public,protected and private members of A in B and in C. Then he asked about the friend functions. Finally o SHARON: TECH 1: the interview was very easy and they stuck to the basics. I was asked about all the OOPS concepts like inheritance,polymorphism etc. He asked questions on virtual functions. He gave me a common puzzle. there are three boxes. one box of blue balls, one green and one mixed ,all labelled incorrectly. In how many trials will i label them correctly. There are 10 weights of which two weigh less than the others. using a balance how will i identify the defective ones. sql query on finding the nth maximum. code for deletion in linked lists. he asked about my projects and my extra-curricular activities. optimal way to find the nth maximum element using a DS TECH 2: He asked me about my favourite technologies,what i liked about facebook. Asked me to design a cinema ticket reservation web site - like the one satyam has. On Sep 22, 6:05 pm, Sahil Garg garg.sahi...@gmail.com wrote: hey plz post ur experience?? Sahil Garg Computer Engg. DCE On Mon, Aug 8, 2011 at 8:43 PM, siva viknesh sivavikne...@gmail.com wrote: not sure i m also gonna attend wit u only if u r from anna univ :P On Aug 6, 7:44 pm, swetha rahul swetharahu...@gmail.com wrote: Thanks Siva... Is it all MCQ or they ask us to code for a problem..?? On Sat, Aug 6, 2011 at 7:35 PM, siva viknesh sivavikne...@gmail.com wrote: Paypal is a subsidiary of ebay .. so i think mostly java .. SCJP level !! On Aug 6, 6:52 pm, swetha rahul swetharahu...@gmail.com wrote: Hi, Can anybody say what is the wriiten test pattern of paypal... :-) What kind of questions are asked ?? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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
Re: [algogeeks] Flip kart
11.5 fr our college they will hve online test .. 3 coding question and u need to attempnt any two ..25mcq's .. mcq;s wer mostly frm sql .. Q- Given a linked list find whether the linked list is palindrome or not. I gave him solution by modifying the linked list then i gave solution using extra space then i gave solution using recursion. First i gave complexity as O(n^2) using brute force. He asked me to reduce the complexity then i moved on to modify the linked list itself, he told me not to modify the linked list. Then i went for the extra linked list. Then he asked me not to use extra space and finally i came up with a recursive solution. And he was very much happy after seeing the recursive solution, i think thats wat he was looking for. Q- I was asked to do a level order traversal in binary tree. I used queue. Q- He asked me to do spiral traversal of a Binary Tree. I used stack and queues for the alternate levels. On Thu, Sep 22, 2011 at 7:54 PM, sagar pareek sagarpar...@gmail.com wrote: 12.5 On Thu, Sep 22, 2011 at 5:49 PM, Adi Srikanth adisriika...@gmail.comwrote: around 11.5 LPA gross Regards, Adi Srikanth. Mob No 9887233349 Personal Pages: adisrikanth.co.nr On Thu, Sep 22, 2011 at 11:55 AM, rahul sharma rahul23111...@gmail.comwrote: wats eligibility n package? On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek sagarpar...@gmail.comwrote: nit allahabad On Thu, Sep 22, 2011 at 12:20 AM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: which college may i know? On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek sagarpar...@gmail.comwrote: it is coming in my college On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: How did u applied for it? Can you please let me know.. On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek sagarpar...@gmail.com wrote: Hello ... Do anyone know the process and questions of flip kart ?? -- **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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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
Re: [algogeeks] Flip kart
those three question they ASKD me in interview nt in coding round n they are very particular abt coding On Fri, Sep 23, 2011 at 1:53 AM, aditya kumar aditya.kumar130...@gmail.comwrote: 11.5 fr our college they will hve online test .. 3 coding question and u need to attempnt any two ..25mcq's .. mcq;s wer mostly frm sql .. Q- Given a linked list find whether the linked list is palindrome or not. I gave him solution by modifying the linked list then i gave solution using extra space then i gave solution using recursion. First i gave complexity as O(n^2) using brute force. He asked me to reduce the complexity then i moved on to modify the linked list itself, he told me not to modify the linked list. Then i went for the extra linked list. Then he asked me not to use extra space and finally i came up with a recursive solution. And he was very much happy after seeing the recursive solution, i think thats wat he was looking for. Q- I was asked to do a level order traversal in binary tree. I used queue. Q- He asked me to do spiral traversal of a Binary Tree. I used stack and queues for the alternate levels. On Thu, Sep 22, 2011 at 7:54 PM, sagar pareek sagarpar...@gmail.comwrote: 12.5 On Thu, Sep 22, 2011 at 5:49 PM, Adi Srikanth adisriika...@gmail.comwrote: around 11.5 LPA gross Regards, Adi Srikanth. Mob No 9887233349 Personal Pages: adisrikanth.co.nr On Thu, Sep 22, 2011 at 11:55 AM, rahul sharma rahul23111...@gmail.comwrote: wats eligibility n package? On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek sagarpar...@gmail.comwrote: nit allahabad On Thu, Sep 22, 2011 at 12:20 AM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: which college may i know? On Wed, Sep 21, 2011 at 11:29 PM, sagar pareek sagarpar...@gmail.com wrote: it is coming in my college On Wed, Sep 21, 2011 at 10:14 PM, arpit rajpurohit arpit.rajpuro...@gmail.com wrote: How did u applied for it? Can you please let me know.. On Wed, Sep 21, 2011 at 10:05 PM, sagar pareek sagarpar...@gmail.com wrote: Hello ... Do anyone know the process and questions of flip kart ?? -- **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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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.
[algogeeks] Re: Permuations and Combinations
Start by making a copy of the input array containing the sequence of numbers. Sort the array. We'll call the copy A[n]. permute(int *a, int n, int k, int p=0) { if (p == k) output(a); else { int tmp = a[p]; for(int i = p; i n; ++i) { a[p] = a[i]; permute(a,n,p+1,k-1); } a[p] = tmp; } } To generate permutations of the array, call permute(A, n, n); Complexity is O(n!), which is the same as the size of the output. Don On Sep 22, 2:53 pm, kumar raja rajkumar.cs...@gmail.com wrote: (1) What is the efficient approach to generate permutations of a given sequence of numbers (may contain duplicates) in lexicographic order e.g. i/p: 5,1,6,1 o/p: 1 1 5 6 1 1 6 5 1 5 1 6 1 5 6 1 1 6 1 5 1 6 5 1 5 1 1 6 5 1 6 1 5 6 1 1 6 1 1 5 6 1 5 1 6 5 1 1 what is the time complexity of ur approach?/ (2)What is the efficient approach to generate combinations of a given sequence of numbers (may contain duplicates) in lexicographic order e.g. i/p: {3,2 ,1,5,1,7} and k=2 (2-size subsets) o/p: 1 1 1 2 1 3 1 5 1 7 2 3 2 5 2 7 3 5 3 7 5 7 ( {5,7} is same as {7,5} because it is a selection). what is the time complexity of the algorithm?? -- Regards Kumar Raja M.Tech(SIT) IIT Kharagpur, 10it60...@iitkgp.ac.in 7797137043. 09491690115. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Permuations and Combinations
Start by making a copy of the input array containing the sequence of numbers. Sort the array. We'll call the copy A[n]. permute(int *a, int n, int p=0) { if (p == n) output(a); else { int tmp = a[p]; for(int i = p; i n; ++i) { a[p] = a[i]; permute(a,n,p+1,k-1); } a[p] = tmp; } } To generate permutations of the array, call permute(A, n); Complexity is O(n!), which is the same as the size of the output. Don On Sep 22, 2:53 pm, kumar raja rajkumar.cs...@gmail.com wrote: (1) What is the efficient approach to generate permutations of a given sequence of numbers (may contain duplicates) in lexicographic order e.g. i/p: 5,1,6,1 o/p: 1 1 5 6 1 1 6 5 1 5 1 6 1 5 6 1 1 6 1 5 1 6 5 1 5 1 1 6 5 1 6 1 5 6 1 1 6 1 1 5 6 1 5 1 6 5 1 1 what is the time complexity of ur approach?/ (2)What is the efficient approach to generate combinations of a given sequence of numbers (may contain duplicates) in lexicographic order e.g. i/p: {3,2 ,1,5,1,7} and k=2 (2-size subsets) o/p: 1 1 1 2 1 3 1 5 1 7 2 3 2 5 2 7 3 5 3 7 5 7 ( {5,7} is same as {7,5} because it is a selection). what is the time complexity of the algorithm?? -- Regards Kumar Raja M.Tech(SIT) IIT Kharagpur, 10it60...@iitkgp.ac.in 7797137043. 09491690115. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Permuations and Combinations
Start by making a copy of the input array containing the sequence of numbers. Sort the array. We'll call the copy A[n]. permute(int *a, int n, int p=0) { if (p == n) output(a); else { int tmp = a[p]; for(int i = p; i n; ++i) { a[p] = a[i]; a[i] = tmp; permute(a,n,p+1,k-1); a[i] = a[p]; } a[p] = tmp; } } To generate permutations of the array, call permute(A, n); Complexity is O(n!), which is the same as the size of the output. Don On Sep 22, 2:53 pm, kumar raja rajkumar.cs...@gmail.com wrote: (1) What is the efficient approach to generate permutations of a given sequence of numbers (may contain duplicates) in lexicographic order e.g. i/p: 5,1,6,1 o/p: 1 1 5 6 1 1 6 5 1 5 1 6 1 5 6 1 1 6 1 5 1 6 5 1 5 1 1 6 5 1 6 1 5 6 1 1 6 1 1 5 6 1 5 1 6 5 1 1 what is the time complexity of ur approach?/ (2)What is the efficient approach to generate combinations of a given sequence of numbers (may contain duplicates) in lexicographic order e.g. i/p: {3,2 ,1,5,1,7} and k=2 (2-size subsets) o/p: 1 1 1 2 1 3 1 5 1 7 2 3 2 5 2 7 3 5 3 7 5 7 ( {5,7} is same as {7,5} because it is a selection). what is the time complexity of the algorithm?? -- Regards Kumar Raja M.Tech(SIT) IIT Kharagpur, 10it60...@iitkgp.ac.in 7797137043. 09491690115. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Questions on Graphs
Given an undirected graph in which each edge has a capacity, find the maximum capacity from node A to node B. Given a directed graph where each edge has a cost, find the lowest cost path from node A to node B. Find the minimal spanning tree of a weighted, connected graph. On Sep 22, 2:03 pm, Ankur Garg ankurga...@gmail.com wrote: Hi Frnds Can anybody suggest me some questions typically asked on Graphs . Couldnt find much in the internet If some one can share link or few questions on Graphs it will be really helpful Thanks in Advance Ankur -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: question
Isn't it simply finding the next permutation of a number??? On Thu, Sep 22, 2011 at 7:01 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: @bharat...so i thnk 7585 shud hav 7855 as ans..!! On Thu, Sep 22, 2011 at 5:42 PM, Arpit Sood soodfi...@gmail.com wrote: @yogesh nice algo... it is not even required to sort the left out array, just reverse it :) On Thu, Sep 22, 2011 at 5:05 PM, Yogesh Yadav medu...@gmail.com wrote: @ratan: thanks for correction little correction in my logic... start from rightmost digit and search towards left a digit less than this... if found ... just swap...now after swapping save the index with which you are swapping ...and after that sort the array in ascending order...u got the answer... if no small digit found then select second rightmost digit and follow the same process...and so on... for ex: 759354 rightmost digit =4 search for smaller digit than 4 towards left... it will be 3... then 7594(53) now make the array in brackets in ascending order... answer 759435 now am i right?? On Thu, Sep 22, 2011 at 4:55 PM, Ratan success.rata...@gmail.comwrote: the answer should be 759435... On Thu, Sep 22, 2011 at 4:45 PM, Yogesh Yadav medu...@gmail.com wrote: my logic: if wrong then plz tell... start from rightmost digit and search towards left a digit less than this... if found ... just swap...u got the answer... if no small digit found then select second rightmost digit and follow the same process...and so on... for ex: 759354 rightmost digit =4 search for smaller digit than 4 towards left... it will be 3... then answer 759453 On Thu, Sep 22, 2011 at 4:40 PM, Yogesh Yadav medu...@gmail.com wrote: @algo geek: there is some error in your logic... consider a number 759845 according to ur logic the number greater than this will be 784559 but it should be 759854 . On Thu, Sep 22, 2011 at 4:24 PM, algo geek geeka...@gmail.com wrote: Keep a pointer ont the rightmost digit. Keep moving right until you find the number in increasing number. As soon as this breaks. stop. Swap the digit at the current position with the smallest digit, but larger than the current position digit, sort the array to the right of the current position in descending order. explanation: NUMBER:759854 INDEX: 012356 Keep the pointer at index 6. Keep moving right as long as numbers are in increasing fashion. Stop at index 1. swap this digit with the smallest digit larger than 5 i.e. 8 78(9554) now sort the array in parenthesis in descending order ans : 784559 For the implementation you can actually create an array of length 10, to keep track of all the digits encounters while moving left. This will help in sorting as well (similar to counting sort). One pass will do the work. You can print the answer directly afterwards. With Regards Unknown On Thu, Sep 22, 2011 at 4:13 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: in nlog(n) #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int t; void quicksort(char arr[],int left,int right) { if(leftright) { int piv=right; int i=left,j=left; while((iright) (jright)) { if(arr[j]arr[piv]) { swap(arr[i],arr[j],t); i++; } j++; } swap(arr[i],arr[piv],t); quicksort(arr,left,i-1); quicksort(arr,i+1,right); } } int main() { char str[100],t; int arr[100],i=0; cinstr; int min=0; int len=strlen(str); while(str[i]) { if(str[i]=str[min]) min=i; arr[i]=min; i++; } i=len-1; while((arr[i]==i)(i0)) i--; swap(str[i],str[arr[i]],t); if(i0) quicksort(str,arr[i]+1,len-1); coutstr; getch(); } On Thu, Sep 22, 2011 at 3:33 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: #includeiostream #includeconio.h #includestring.h #define swap(a,b,c) (c)=(a),(a)=(b),(b)=(c) using namespace std; int main() { char str[100],t; cinstr; int len=strlen(str); int i,x,boo=1; for(i=len-1;i0boo;i--) { for(x=i-1;x=0boo;x--) { if(str[x]str[i]) { swap(str[x],str[i],t); boo=0; } } } if(i0) { //Sorting... for(int l=x+2;llen-1;l++) { int min=l;
Re: [algogeeks] Re: Questions on Graphs
Thanks Don :) On Fri, Sep 23, 2011 at 2:51 AM, Don dondod...@gmail.com wrote: Given an undirected graph in which each edge has a capacity, find the maximum capacity from node A to node B. Given a directed graph where each edge has a cost, find the lowest cost path from node A to node B. Find the minimal spanning tree of a weighted, connected graph. On Sep 22, 2:03 pm, Ankur Garg ankurga...@gmail.com wrote: Hi Frnds Can anybody suggest me some questions typically asked on Graphs . Couldnt find much in the internet If some one can share link or few questions on Graphs it will be really helpful Thanks in Advance Ankur -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: question
I have seen code and output but I think it should be 7965 am i right? if you are looking for first largest On Thu, Sep 22, 2011 at 12:46 AM, Anil Arya anilarya...@gmail.com wrote: http://ideone.com/pmil8 On Thu, Sep 22, 2011 at 12:46 AM, Anil Arya anilarya...@gmail.com wrote: @kartik Is it right On Wed, Sep 21, 2011 at 10:24 PM, kartik sachan kartik.sac...@gmail.comwrote: obivously it will be first largest -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Microsoft Question
@kartik.,...where are u searching..that ..the next character should be present..only around the 8 possible locations around that character On Thu, Sep 22, 2011 at 6:34 AM, kartik sachan kartik.sac...@gmail.comwrote: @dheeraj i didn't get what u want to say explain me with the help of example -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Dheeraj Sharma* Comp Engg. NIT Kurukshetra -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] AMDOCS
can anybody tell me the pattern of amdocs written test and interview qus. its urgent so plz -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: THANX ALGOGEEKS !!!!!!
congrats dude On Thu, Sep 22, 2011 at 10:51 PM, sukran dhawan sukrandha...@gmail.comwrote: congrats On Thu, Sep 22, 2011 at 10:33 PM, Prakash D cegprak...@gmail.com wrote: congrats brother!! On Thu, Sep 22, 2011 at 6:42 PM, saurabh sah.saurab...@gmail.com wrote: thanx to all I have shared my interview experience at http://msidcinterview.blogspot.com/ ta -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Re: question
@Yogesh Yadav algo geek's approach is correct. With your number 759845. When you start moving left from right most integer, you stop when the numbers are no longer in increasing order, in this case you stop at first integer i.e, at 5 and swap with 4. Which gives exactly same correct answer as you have mentioned. On Fri, Sep 23, 2011 at 8:36 AM, Abhishek Goswami zeal.gosw...@gmail.comwrote: I have seen code and output but I think it should be 7965 am i right? if you are looking for first largest On Thu, Sep 22, 2011 at 12:46 AM, Anil Arya anilarya...@gmail.com wrote: http://ideone.com/pmil8 On Thu, Sep 22, 2011 at 12:46 AM, Anil Arya anilarya...@gmail.comwrote: @kartik Is it right On Wed, Sep 21, 2011 at 10:24 PM, kartik sachan kartik.sac...@gmail.com wrote: obivously it will be first largest -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- *Anil Arya, Computer Science * *Motilal Nehru National Institute of Technology,Allahabad . * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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.