Re: [algogeeks] Data Structure
String hashing On Tue, Sep 18, 2012 at 5:21 PM, Ashish Goel wrote: > stack > > Best Regards > Ashish Goel > "Think positive and find fuel in failure" > +919985813081 > +919966006652 > > > > On Tue, Sep 18, 2012 at 3:55 PM, Sheetal Naidu wrote: > >> sqlite database for mozilla...maybe hashtable >> >> >> On 18 September 2012 13:20, Navin Kumar wrote: >> >>> >>> Which data structure is used to maintain browser history? >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Algorithm Geeks" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/algogeeks/-/MCj-0bFwvV0J. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> >> >> -- >> - A.Sheetal >> B.tech, Final yr, >> Department Of Information Technology, >> NIT, Durgapur >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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 -- 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] Need help regarding threads
It was telling that error after doing some modifications... Yeah i think bharat u r saying correct... I will try it... Thanks for reply... On Sat, Mar 31, 2012 at 11:45 AM, bharat b wrote: > u should get an error: argument of type ‘void* (TraCISagar::)(void*)’ does > not match ‘void* (*)(void*)’ ... > The function which is threaded should be either static or global in > pthread implementation ... > > > On Tue, Mar 27, 2012 at 7:20 PM, Sagar Pareek wrote: > >> Thanks for reply >> but tell me two thing , is it true or not? >> is NULL is not equal to (void*)0 ?? >> AND >> int a=20; >> int b=(int)a ; // Whats wrong in here?? >> >> Similarly for >> void * TraCISagar::sender(void* a); >> >> then while calling in pthread as >> pthread_create(&thread1,NULL,(void*)sender,NULL) >> instead of >> pthread_create(&thread1,NULL,sender,NULL); >> >> >> by the way i already implemented NULL instead of (void*)0 >> and >> pthread_create(&thread1,NULL,sender,NULL); >> >> But not getting why this problem is occurring? >> >> >> On Tue, Mar 27, 2012 at 8:37 AM, SAMM wrote: >> >>> Yaa Senthil is right , I overlooked it . In 3rd argument also it is >>> expecting an address while u r passing the pointer . >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from 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 -- >> 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. >> > > > > -- > > **Regards > * > * > > Bharat B | M.Tech II | C.S.E | IITM > * > * > *Ph: +91 8056127652* > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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 -- 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] Need help regarding threads
Thanks for reply but tell me two thing , is it true or not? is NULL is not equal to (void*)0 ?? AND int a=20; int b=(int)a ; // Whats wrong in here?? Similarly for void * TraCISagar::sender(void* a); then while calling in pthread as pthread_create(&thread1,NULL,(void*)sender,NULL) instead of pthread_create(&thread1,NULL,sender,NULL); by the way i already implemented NULL instead of (void*)0 and pthread_create(&thread1,NULL,sender,NULL); But not getting why this problem is occurring? On Tue, Mar 27, 2012 at 8:37 AM, SAMM wrote: > Yaa Senthil is right , I overlooked it . In 3rd argument also it is > expecting an address while u r passing the pointer . > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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 -- SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Need help regarding threads
Hello all, I need help regarding thread implementation in C++ Here is my sample code... *class TraCISagar : public BasicModule1 { public: . . void activity(); void* sender(void*); . . }; void* TraCISagar::sender(void* a) { . . . } void TraCISagar::activity() { pthread_t thread1; . . pthread_create(&thread1,NULL,(void*)sender,(void*)0); //problem coming here . . pthread_join(thread1,NULL); } int main() { . . . . }* And error is invalid use of member (did you forget the ‘&’ ?) Do anyone of you know how to solve it? -- **KIND 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] NIT Kurukshetra presents Online programming contest- ENCODER
You must make corrections... no event on 24 feb http://www.codechef.com/contests On Tue, Feb 21, 2012 at 10:43 AM, Mohit Goel wrote: > * *Hi Geeks > > > We duly invite you all to participate in ENCODER - Algorithm Intensive > Online Programming Contest, presented by NIT KURUKSHETRA in association > with CODECHEF. > > *Event Guidelines* > > · The event will be held on *24th February, 2012* from *5-10 pm*. > > · It’s a team event. A team may consist of not more than two > members. > > · Participants must be *students * and can belong to only one > team . > > · Student must register on *CodeChef* and then register at > > > > https://docs.google.com/spreadsheet/viewform?formkey=dDUxSnJ6elAtNmdsYjhCMHFMdG5ReFE6MQ > > So put your software dexterity to the test and emerge as the ultimate > software techie.** > > * > * > > For further queries contact: > > Sachin Bansal > > sacban1...@gmail.com > > 9728145647 > > Puneet Chawla > > puneetchawla...@gmail.com > > 8950342490 > > Sanjay Rajpal > > srn...@gmail.com > > 8053566286 > > Mohit Goel > > mohitgoel291...@gmail.com > > 9671537693 > > * > * > > > > > > > > > > > > > > > > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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 -- 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] Re: Find Largest number in log(n)
Thanks Dave, Don and all others for this clarification. On Mon, Dec 12, 2011 at 11:23 PM, Prakash D wrote: > only the number of comparisons is log(n) > > > On Mon, Dec 12, 2011 at 11:04 PM, Ankur Garg wrote: > >> Agree with dave..Its still O(n) >> >> >> On Mon, Dec 12, 2011 at 10:57 PM, Dave wrote: >> >>> @Sagar: Don is correct. n/2+n/4+n/8+... ~= n. But even the first >>> round, involving n/2 comparisons, is O(n). >>> >>> Dave >>> >>> On Dec 12, 11:23 am, sagar pareek wrote: >>> > Yes Mr. DoN >>> > >>> > First round of Tournament sort results in log(n) time for finding >>> largest >>> > no. >>> > >>> > n/2+n/4+n/8 results n/(2^i) where ^ = power >>> > >>> > >>> > >>> > >>> > >>> > On Mon, Dec 12, 2011 at 8:16 AM, Don wrote: >>> > > No. To find the largest number in an unsorted array requires looking >>> > > at each number, which is order n by definition. >>> > > Don >>> > >>> > > On Dec 12, 10:02 am, sagar pareek wrote: >>> > > > Hi every one. >>> > >>> > > > Can we find largest number from an unsorted array in log(n) ? >>> > >>> > > > -- >>> > > > **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. >>> > >>> > -- >>> > **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] Re: Find Largest number in log(n)
Yes Mr. DoN First round of Tournament sort results in log(n) time for finding largest no. n/2+n/4+n/8 results n/(2^i) where ^ = power On Mon, Dec 12, 2011 at 8:16 AM, Don wrote: > No. To find the largest number in an unsorted array requires looking > at each number, which is order n by definition. > Don > > On Dec 12, 10:02 am, sagar pareek wrote: > > Hi every one. > > > > Can we find largest number from an unsorted array in log(n) ? > > > > -- > > **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. > > -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: Find Largest number in log(n)
I think... First round of tournament sort. :D On Mon, Dec 12, 2011 at 8:02 AM, sagar pareek wrote: > Hi every one. > > > Can we find largest number from an unsorted array in log(n) ? > > -- > **Regards > SAGAR PAREEK > COMPUTER SCIENCE AND ENGINEERING > NIT ALLAHABAD > > -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Find Largest number in log(n)
Hi every one. Can we find largest number from an unsorted array in log(n) ? -- **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] Hired by Symantec :) :)
cONGRATES On Sat, Oct 1, 2011 at 7:34 PM, rahul sharma wrote: > > congrats buddy > > On Sat, Oct 1, 2011 at 6:51 PM, siva viknesh wrote: > >> I should definitely thank this group and all its members. This >> group played a vital role in my placement preparations and surely it >> was an excellent "doubt clearing" group. >> >> To mention some instance I read about "mutex and semaphore" in many >> sites which is not so good, but in this group, some of the members >> gave mind-blowing awesome explanations..which on the very next day a >> company asked a question applying a similar concept. >> >> Thanks a lot ppl :) U helped me a lot directly or indirectly in >> getting me placed :) >> >> Will soon come up with my detailed interview experiences. >> >> Proud to be one of the moderators of this group :) >> >> Wish all final years get dream offers :) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from 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] Re: MICROSOFT IDC
congrates dude On Thu, Sep 22, 2011 at 7:26 PM, Sanjay Rajpal wrote: > Saurabh : Thank u very much :) > > Sanju > :) > > > > On Thu, Sep 22, 2011 at 6:15 AM, saurabh 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. > -- **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] Flip kart
and would u like to please tell me the online coding questions... On Fri, Sep 23, 2011 at 1:10 PM, sagar pareek wrote: > thanx a ton > one more query... > was mcq is in online test? > > > On Fri, Sep 23, 2011 at 1:54 AM, aditya kumar < > aditya.kumar130...@gmail.com> wrote: > >> 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.com> wrote: >> >>> 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 wrote: >>> >>>> 12.5 >>>> >>>> >>>> On Thu, Sep 22, 2011 at 5:49 PM, Adi Srikanth >>>> wrote: >>>> >>>>> 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.com> wrote: >>>>> >>>>>> wats eligibility n package? >>>>>> >>>>>> >>>>>> On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek >>>>> > wrote: >>>>>> >>>>>>> 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 >>>>>>>>>>> algogeek
Re: [algogeeks] Flip kart
thanx a ton one more query... was mcq is in online test? On Fri, Sep 23, 2011 at 1:54 AM, aditya kumar wrote: > 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.com> wrote: > >> 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 wrote: >> >>> 12.5 >>> >>> >>> On Thu, Sep 22, 2011 at 5:49 PM, Adi Srikanth wrote: >>> >>>> 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 >>> > wrote: >>>> >>>>> wats eligibility n package? >>>>> >>>>> >>>>> On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek >>>>> wrote: >>>>> >>>>>> 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.c
Re: [algogeeks] Flip kart
12.5 On Thu, Sep 22, 2011 at 5:49 PM, Adi Srikanth wrote: > 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 wrote: > >> wats eligibility n package? >> >> >> On Thu, Sep 22, 2011 at 12:26 AM, sagar pareek wrote: >> >>> 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 >>>> 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. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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
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 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 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.
Re: [algogeeks] Flip kart
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 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.
[algogeeks] Flip kart
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.
Re: [algogeeks] Re: Directi Questions - needed answers
tournament tree.in each round one value is eliminated >>>>>> to obtain in the process the winner or the highest value in n-1 >>>>>> comparisons. >>>>>> Then check the queue of the winner which contains log(n) entries of the >>>>>> values beaten by the winner which implicitly will contain the runners >>>>>> up.Then log(n)-1 comparisons to find the highest among all the losers >>>>>> whom >>>>>> the winner had beaten. So all over complexity will be n-1 +log(n) -1 = >>>>>> n+log(n)-2. Hp that answers ur query. nice question btw :) >>>>>> >>>> >>>>>> >>>> >>>>>> >>>> On Sun, Sep 18, 2011 at 8:02 AM, VIHARRI >>>>>> wrote: >>>>>> >>>>> >>>>>> >>>>> hey i'm also thinking n + logn -2.. but couldnt able to figure >>>>>> out >>>>>> >>>>> how??? can you please explain the logic >>>>>> >>>>> >>>>>> >>>>> -- >>>>>> >>>>> You received this message because you are subscribed to the >>>>>> Google Groups "Algorithm Geeks" group. >>>>>> >>>>> To post to this group, send email to algogeeks@googlegroups.com >>>>>> . >>>>>> >>>>> To unsubscribe from 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. >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > -- >>>>>> > Nitin Garg >>>>>> > >>>>>> > "Personality can open doors... but only Character can keep them >>>>>> open" >>>>>> > >>>>>> > -- >>>>>> > You received this message because you are subscribed to the Google >>>>>> Groups "Algorithm Geeks" group. >>>>>> > To post to this group, send email to algogeeks@googlegroups.com. >>>>>> > To unsubscribe from 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. >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Bhanu Chowdary >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Algorithm Geeks" group. >>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>> To unsubscribe from this group, send email to >>>>> algogeeks+unsubscr...@googlegroups.com. >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>> >>>> >>>> >>>> >>>> -- >>>> Nitin Garg >>>> >>>> "Personality can open doors... but only Character can keep them open" >>>> >>> >>> >>> >>> -- >>> Nitin Garg >>> >>> "Personality can open doors... but only Character can keep them open" >>> >> >> >> >> -- >> Nitin Garg >> >> "Personality can open doors... but only Character can keep them open" >> > > > > -- > Nitin Garg > > "Personality can open doors... but only Character can keep them open" > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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]
Give some examples ,i m not getting ur question On Mon, Sep 19, 2011 at 1:45 AM, UTKARSH SRIVASTAV wrote: > how to find second largest element than current element in an array given > condition that we have to find that second largest element from index 1 to > the index of the current element > > -- > *UTKARSH SRIVASTAV > CSE-3 > B-Tech 3rd Year > @MNNIT ALLAHABAD* > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- **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] c output,printf("%llx")
Check out what u have written... On Sun, Sep 18, 2011 at 7:17 PM, wujin chen wrote: > usigned long long x = 0x12345678; > int a = 0x09; > int b = 0x10; > printf("a=%x, b=%llx",a,b,c); > > the result is: a=9,b=123456780010 > > i wonder why~~ > > can anyone explain it? > thanks. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: Symantec System programming ques
I am supposing that file is count.txt and is already exists so in initials of the main() do this *int count; FILE* fp; if((fp=fopen("count.txt","r"))==NULL) { printf("File does not exist\n"); exit(0): } fscanf(fp,"%d",&count); count++; fclose(fp); fp=fopen("count.txt","w"); fprintf(fp,"%d",&count); fclose(fp); * On Sat, Sep 17, 2011 at 9:36 PM, siva viknesh wrote: > hi anyone at least provide code using file handling.i found this > ques from other site > > On Sep 17, 6:35 pm, sivaviknesh s wrote: > > you have to write a program which tell about how many times it has run. > ex: > > > > if you run first time it will print 1. > > if you run second time it will print 2. > > like this. > > > > this can easily done by File Handling but think other solution like IPC. > > > > after booting your system, your program's output start from 1 > > > > answers plz??? > > > > -- > > Regards, > > $iva > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Networking:suggest some book
Best book is kurose and ross On Sat, Sep 17, 2011 at 7:08 PM, Gaurav Menghani wrote: > On Sat, Sep 17, 2011 at 8:58 AM, hary rathor > wrote: > > 1 frozen > > Hahahaha. It's not 'FROZEN', it is Forouzan :P > ( > http://books.google.com/books/about/Data_Communications_and_Networking.html?id=U3Gcf65Pu9IC > ) > > > 2 steven Vol 1 > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Algorithm Geeks" group. > > To post to this group, send email to algogeeks@googlegroups.com. > > To unsubscribe from this group, send email to > > algogeeks+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/algogeeks?hl=en. > > > > > > -- > Gaurav Menghani > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] A logical Question
it depends that weather boat is on the water or not :P On Thu, Sep 15, 2011 at 12:58 PM, Tamanna Afroze wrote: > > *If you are on a boat and you throw out a suitcase, Will the level of > water increase.* > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] program
Use hashing like counting sort... On Wed, Sep 14, 2011 at 11:20 AM, raj wrote: > program to find the top 3 repeating number from the given array > eg > You r given an array and u have to find out the top 3 repeated > numbers. > for ex: GAURAV[]={20,8,3,7,8,9,20,6,4,6,20,8,20} > so the output will be: 20 is repeated 4 times 8 is repeated 3 times 6 > is repeated 2 times. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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]
And please read my previous post again... i wrote "stupid question"not "u r stupid"... On Sun, Sep 11, 2011 at 4:24 AM, sagar pareek wrote: > @Ayush > I m sorry ... my intention was not to hurt you. > > > On Sat, Sep 10, 2011 at 11:32 PM, shady wrote: > >> easy dude, no one's making fun of you. Who knows you solve this problem in >> future and become a millionaire ? >> >> Just keep posting and contributing to group :) >> >> >> On Sat, Sep 10, 2011 at 11:06 PM, aayush jain wrote: >> >>> @sagar >>> bro i m not intelligent than u so thats why u r making fun of mine..u >>> know one thing >>> God is not giving equal capability of mind and he has given something >>> special to everyone that thing surely is not in u... >>> so think about it before say anythink.. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from 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 > > -- **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]
@Ayush I m sorry ... my intention was not to hurt you. On Sat, Sep 10, 2011 at 11:32 PM, shady wrote: > easy dude, no one's making fun of you. Who knows you solve this problem in > future and become a millionaire ? > > Just keep posting and contributing to group :) > > > On Sat, Sep 10, 2011 at 11:06 PM, aayush jain wrote: > >> @sagar >> bro i m not intelligent than u so thats why u r making fun of mine..u know >> one thing >> God is not giving equal capability of mind and he has given something >> special to everyone that thing surely is not in u... >> so think about it before say anythink.. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from 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]
@aayush Dude... i dont knw from where did u find such a stupid question... Whole cryptography.mean all SSL , RSA , etc etc based on large numbers which have prime factors... if we are able to break them in partitions then whole security is. ! Cryptography's base is wholly and wholly depends on large numbers with large prime factors On Thu, Sep 8, 2011 at 11:25 AM, siddharam suresh wrote: > guys there is subject called number theory and cryptography, in which > there are so many algos to find prime number and prime factors of the > number. > > Thank you, > Sid. > > > > On Thu, Sep 8, 2011 at 11:17 AM, bharatkumar bagana > wrote: > > @sukran : > > sieve of erathothenes algo gives only the prime numbers below a number .. > > How can we find a number's all prime factors using this algo pls > explain > > ... > > > > On Wed, Sep 7, 2011 at 5:15 PM, sukran dhawan > > wrote: > >> > >> sieve of erathothenes algo > >> > >> On Wed, Sep 7, 2011 at 1:36 PM, Yogesh Yadav wrote: > >>> > >>> prime no has only 2 factors. number itself and 1. > >>> > >>> > >>> > >>> On Wed, Sep 7, 2011 at 12:14 PM, aayush jain > wrote: > >>>> > >>>> can anybody tell me the code of find the prime no. and after finding > >>>> prime no. find its prime factore using linkes list?? -- > >>>> You received this message because you are subscribed to the Google > >>>> Groups "Algorithm Geeks" group. > >>>> To post to this group, send email to algogeeks@googlegroups.com. > >>>> To unsubscribe from this group, send email to > >>>> algogeeks+unsubscr...@googlegroups.com. > >>>> For more options, visit this group at > >>>> http://groups.google.com/group/algogeeks?hl=en. > >>> > >>> -- > >>> You received this message because you are subscribed to the Google > Groups > >>> "Algorithm Geeks" group. > >>> To post to this group, send email to algogeeks@googlegroups.com. > >>> To unsubscribe from this group, send email to > >>> algogeeks+unsubscr...@googlegroups.com. > >>> For more options, visit this group at > >>> http://groups.google.com/group/algogeeks?hl=en. > >> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "Algorithm Geeks" group. > >> To post to this group, send email to algogeeks@googlegroups.com. > >> To unsubscribe from this group, send email to > >> algogeeks+unsubscr...@googlegroups.com. > >> For more options, visit this group at > >> http://groups.google.com/group/algogeeks?hl=en. > > > > > > > > -- > > > > Please do not print this e-mail until urgent requirement. Go Green!! > > Save Papers <=> Save Trees > > BharatKumar Bagana > > http://www.google.com/profiles/bagana.bharatkumar > > Mobile +91 8056127652 > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Algorithm Geeks" group. > > To post to this group, send email to algogeeks@googlegroups.com. > > To unsubscribe from 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] IP Address
+1 to anup On Wed, Sep 7, 2011 at 8:08 AM, Anup Ghatage wrote: > I think It depends on the IP version you willbe using. > > If it is IPv4 then it is: > struct in_addr and struct sockaddr_in > > If it is IPv6 then it is: > struct in6_addr and struct sockaddr_in6 > > Also there is a struct sockaddr_storage for generic storage and > interconversion of IP address' if you don't know which version it is. > > On Tue, Sep 6, 2011 at 1:51 PM, sagar pareek wrote: > >> @ r_shetty >> >> search >> 1. struct in_addr >> 2. struct sockaddr_in >> >> >> On Mon, Sep 5, 2011 at 10:04 PM, teja bala wrote: >> >>> resource records which is a 5 >>> tuple(domain_name,type,value,class,time_to_live) is returned to respective >>> browser request when a resolver gets called.. >>> >>> >>> On Mon, Sep 5, 2011 at 9:46 PM, rShetty wrote: >>> >>>> Which is the data Structure used to store the IP addresses in a >>>> network ? >>>> Please Elaborate? >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algogeeks@googlegroups.com. >>>> To unsubscribe from 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. >> > > > > -- > 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. > -- **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] IP Address
@ r_shetty search 1. struct in_addr 2. struct sockaddr_in On Mon, Sep 5, 2011 at 10:04 PM, teja bala wrote: > resource records which is a 5 > tuple(domain_name,type,value,class,time_to_live) is returned to respective > browser request when a resolver gets called.. > > > On Mon, Sep 5, 2011 at 9:46 PM, rShetty wrote: > >> Which is the data Structure used to store the IP addresses in a >> network ? >> Please Elaborate? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from 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] Network Question
One more thing CIDR On Mon, Sep 5, 2011 at 10:49 PM, sagar pareek wrote: > Google it:- > > Auto-summarization > longest prefix match > supernetting > i think thats enough > > > On Mon, Sep 5, 2011 at 10:06 PM, Neha Singh wrote: > >> @sagar : Can u give me any reference where such a networking is done ?? >> Any link or text book reference ?? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from 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 > > -- **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] Network Question
Google it:- Auto-summarization longest prefix match supernetting i think thats enough On Mon, Sep 5, 2011 at 10:06 PM, Neha Singh wrote: > @sagar : Can u give me any reference where such a networking is done ?? > Any link or text book reference ?? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Tejas networks
nope sam primilarity testing is not sufficient On Mon, Sep 5, 2011 at 9:17 PM, SAMM wrote: > Question no 1: > > Find the fibonacci number as usual and check whether the current > fibonacci numbed is prime using Miller primality test .Tht will do... > > On 9/5/11, sagar pareek wrote: > > thanks bharat > > > > On Mon, Sep 5, 2011 at 1:47 PM, bharatkumar bagana < > > bagana.bharatku...@gmail.com> wrote: > > > >> http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm > >> For Q4): Dijkstra is the best one .. as there is no root for negative > >> weight edge ... > >> Floyds algo gives all pairs shortest path with negative weight edges > also > >> .. so that doesn't work in this situation ... > >> > >> > >> On Sun, Sep 4, 2011 at 6:22 PM, aditya kumar < > aditya.kumar130...@gmail.com > >> > wrote: > >> > >>> q4) floyds algorithm for shortest path . > >>> > >>> > >>> On Sun, Sep 4, 2011 at 5:41 PM, sukran dhawan > >>> wrote: > >>> > >>>> for q3 :either both inorder and preorder traversal shud be stored or > >>>> inorder and postorder shud be stored > >>>> > >>>> > >>>> On Sun, Sep 4, 2011 at 2:54 PM, sukran dhawan > >>>> wrote: > >>>> > >>>>> > >>>>> > >>>>> -- Forwarded message -- > >>>>> From: sukran dhawan > >>>>> Date: Sun, Sep 4, 2011 at 2:53 PM > >>>>> Subject: Re: [algogeeks] Tejas networks > >>>>> To: algogeeks@googlegroups.com > >>>>> > >>>>> > >>>>> reverse a linked list > >>>>> > >>>>> void reverse(struct node ** head) > >>>>> { > >>>>> struct node * last,*temp; > >>>>> > >>>>> last = *head; > >>>>> while(last->next != null) > >>>>> last = last->next; > >>>>> > >>>>> while(*head != last) > >>>>> { > >>>>> temp = *head; > >>>>> *head = (*head)->next; > >>>>> temp->next = last->next; > >>>>> last->next = temp > >>>>> } > >>>>> } > >>>>> > >>>>> On Sun, Sep 4, 2011 at 2:46 PM, Anup Ghatage > wrote: > >>>>> > >>>>>> Could you please give an example for question 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. > >>>>>> > >>>>> > >>>>> > >>>>> > >>>> -- > >>>> You received this message because you are subscribed to the Google > >>>> Groups > >>>> "Algorithm Geeks" group. > >>>> To post to this group, send email to algogeeks@googlegroups.com. > >>>> To unsubscribe from this group, send email to > >>>> algogeeks+unsubscr...@googlegroups.com. > >>>> For more options, visit this group at > >>>> http://groups.google.com/group/algogeeks?hl=en. > >>>> > >>> > >>> -- > >>> You received this message because you are subscribed to the Google > Groups > >>> "Algorithm Geeks" group. > >>> To post to this group, send email to algogeeks@googlegroups.com. > >>> To unsubscribe from this group, send email to > >>> algogeeks+unsubscr...@googlegroups.com. > >>> For more options, visit this group at > >>> http://groups.google.com/group/algogeeks?hl=en. > >>> > >> > >> > >> > >> -- > >> > >> **Please do not print this e-mail until urgent requirement. Go Green!! > >> Save Papers <=> Save Trees > >> *BharatKumar Bagana* > >> **http://www.google.com/profiles/bagana.bharatkumar< >
Re: [algogeeks] Network Question
I got solutions from max people...half are saying its possible and half are saying its not.. Neha please u must read what longest prefix match On Mon, Sep 5, 2011 at 9:44 PM, sagar pareek wrote: > oh pls neha i am doing my majors in networking.. > > > On Mon, Sep 5, 2011 at 9:06 PM, Neha Singh wrote: > >> @sagar : >> U can't use subnets 10.0.1.0/24 and 10.0.1.0/ <http://10.0.1.0/24>26 in >> the same LAN >> >> I think u must 1st study what subnetting is and how it is done >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from 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 > > -- **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] Network Question
oh pls neha i am doing my majors in networking.. On Mon, Sep 5, 2011 at 9:06 PM, Neha Singh wrote: > @sagar : > U can't use subnets 10.0.1.0/24 and 10.0.1.0/ <http://10.0.1.0/24>26 in > the same LAN > > I think u must 1st study what subnetting is and how it is done > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Tejas networks
thanks bharat On Mon, Sep 5, 2011 at 1:47 PM, bharatkumar bagana < bagana.bharatku...@gmail.com> wrote: > http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm > For Q4): Dijkstra is the best one .. as there is no root for negative > weight edge ... > Floyds algo gives all pairs shortest path with negative weight edges also > .. so that doesn't work in this situation ... > > > On Sun, Sep 4, 2011 at 6:22 PM, aditya kumar > wrote: > >> q4) floyds algorithm for shortest path . >> >> >> On Sun, Sep 4, 2011 at 5:41 PM, sukran dhawan wrote: >> >>> for q3 :either both inorder and preorder traversal shud be stored or >>> inorder and postorder shud be stored >>> >>> >>> On Sun, Sep 4, 2011 at 2:54 PM, sukran dhawan wrote: >>> >>>> >>>> >>>> -- Forwarded message -- >>>> From: sukran dhawan >>>> Date: Sun, Sep 4, 2011 at 2:53 PM >>>> Subject: Re: [algogeeks] Tejas networks >>>> To: algogeeks@googlegroups.com >>>> >>>> >>>> reverse a linked list >>>> >>>> void reverse(struct node ** head) >>>> { >>>> struct node * last,*temp; >>>> >>>> last = *head; >>>> while(last->next != null) >>>> last = last->next; >>>> >>>> while(*head != last) >>>> { >>>> temp = *head; >>>> *head = (*head)->next; >>>> temp->next = last->next; >>>> last->next = temp >>>> } >>>> } >>>> >>>> On Sun, Sep 4, 2011 at 2:46 PM, Anup Ghatage wrote: >>>> >>>>> Could you please give an example for question 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. >>>>> >>>> >>>> >>>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > > **Please do not print this e-mail until urgent requirement. Go Green!! > Save Papers <=> Save Trees > *BharatKumar Bagana* > **http://www.google.com/profiles/bagana.bharatkumar<http://www.google.com/profiles/bagana.bharatkumar> > * > Mobile +91 8056127652* > > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: Network Question
common yaar i m in a LAN so why to use NAT ?? please see once again the question and try to answer On Sun, Sep 4, 2011 at 7:10 PM, aditya kumar wrote: > > for communication with other n/w they use NAT . > along with the i/p address port number is also stored in the table . > On Sat, Sep 3, 2011 at 11:54 PM, sagar pareek wrote: > >> mask* >> >> >> On Sat, Sep 3, 2011 at 11:54 PM, sagar pareek wrote: >> >>> ok i know it will match longest mask...but then it will always skip the >>> ip of shorter mast if it has same ip address >>> >>> >>> On Sat, Sep 3, 2011 at 10:15 PM, sukran dhawan >>> wrote: >>> >>>> ya the longest mask matching will take place >>>> >>>> >>>> On Sat, Sep 3, 2011 at 9:17 PM, VIHARRI wrote: >>>> >>>>> I think the communication problem is just bcoz of longest prefix >>>>> match... >>>>> >>>>> On Sep 3, 10:09 am, Vengadanathan wrote: >>>>> > ya both the subnet can exisit in the same network , but problem is >>>>> > lack of communication between the two subnets ,because in routing >>>>> > table of the router the record for 10.0.1.0/26 will be first then >>>>> > record for 10.0.1.0/24 will be , so 10.0.1.0/26 will be given first >>>>> > preference , so subnet 10.0.1.0/26 cannot communicate with >>>>> 10.0.1.0/24 >>>>> > having same ip node more over packet sent within 10.0.1.0/24 will >>>>> > reach 10.0.1.0/26 not to the nodes on the same network .. so >>>>> > 10.0.1.0/24 can communicate with 10.0.1.0/26 >>>>> > but cannot communicate within itself .. >>>>> > >>>>> > On Sep 3, 9:38 am, bharatkumar bagana >>>>> > wrote: >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > > all the addresses which come under second addr will also come under >>>>> first >>>>> > > >>>>> > > Can those 2 be exist in same LAN ? >>>>> > > If yes , how can router decides to which subnet it has to pass >>>>> through the >>>>> > > incoming packet .. >>>>> > >>>>> > > On Fri, Sep 2, 2011 at 6:36 PM, aditya kumar >>>>> > > wrote: >>>>> > >>>>> > > > their wont be any conflict in ip address . coz within dhcp >>>>> assigns ip >>>>> > > > adsress from the pool of available address and within the n/w >>>>> (LAN) we need >>>>> > > > to have unique ip address bt across the n/w (LAN) we can use same >>>>> ip from >>>>> > > > the pool of ip addresses . >>>>> > >>>>> > > > On Sat, Sep 3, 2011 at 1:56 AM, sagar pareek < >>>>> sagarpar...@gmail.com>wrote: >>>>> > >>>>> > > >> It is urgent to get the answer thats why i m posting network >>>>> question >>>>> > > >> here... searching on net is not working >>>>> > >>>>> > > >> HI !! >>>>> > > >> I stuck on a question related to VLSM >>>>> > >>>>> > > >> Suppose we have two subnets as >>>>> > >>>>> > > >> 10.0.1.0/24 valid ip address can be 10.0.1.2 >>>>> > >>>>> > > >> and >>>>> > >>>>> > > >> 10.0.1.0/26 here also valid ip address can be 10.0.1.2 >>>>> > >>>>> > > >> now suppose we are using these two subnets in a LAN and having >>>>> this ip >>>>> > > >> (10.0.1.2) in both the subnets then is there any IP conflict >>>>> will happen or >>>>> > > >> not? >>>>> > >>>>> > > >> -- >>>>> > > >> **Regards >>>>> > > >> SAGAR PAREEK >>>>> > > >> COMPUTER SCIENCE AND ENGINEERING >>>>> > > >> NIT ALLAHABAD >>>>> > >>>>> > > >> -- >>>>> > > >> You received this message because you are subscribed to the &
[algogeeks] Tejas networks
Please tell most efficient algo 1. Write a method to find the prime fibonacci numbers. eg. 1,1,2,3,5,8,13 are fibonacci 2,3,5,7,11,12... are prime. 2,3,5,13.are prime fibonacci. 2. Write a program to reverse a linked list using O(1) space. 3. Write the traversal of a tree into a file and then recreate the tree using the file. 4. There is a matrix where a[i][j] =-1 if there is no train going from i station to j station. = 0 if i=j. = n if there is a train going from station i to j taking n hours. Given a starting station and destination station, find the minimum possible path from s to d. -- **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] Re: Network Question
mask* On Sat, Sep 3, 2011 at 11:54 PM, sagar pareek wrote: > ok i know it will match longest mask...but then it will always skip the ip > of shorter mast if it has same ip address > > > On Sat, Sep 3, 2011 at 10:15 PM, sukran dhawan wrote: > >> ya the longest mask matching will take place >> >> >> On Sat, Sep 3, 2011 at 9:17 PM, VIHARRI wrote: >> >>> I think the communication problem is just bcoz of longest prefix >>> match... >>> >>> On Sep 3, 10:09 am, Vengadanathan wrote: >>> > ya both the subnet can exisit in the same network , but problem is >>> > lack of communication between the two subnets ,because in routing >>> > table of the router the record for 10.0.1.0/26 will be first then >>> > record for 10.0.1.0/24 will be , so 10.0.1.0/26 will be given first >>> > preference , so subnet 10.0.1.0/26 cannot communicate with 10.0.1.0/24 >>> > having same ip node more over packet sent within 10.0.1.0/24 will >>> > reach 10.0.1.0/26 not to the nodes on the same network .. so >>> > 10.0.1.0/24 can communicate with 10.0.1.0/26 >>> > but cannot communicate within itself .. >>> > >>> > On Sep 3, 9:38 am, bharatkumar bagana >>> > wrote: >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > > all the addresses which come under second addr will also come under >>> first >>> > > >>> > > Can those 2 be exist in same LAN ? >>> > > If yes , how can router decides to which subnet it has to pass >>> through the >>> > > incoming packet .. >>> > >>> > > On Fri, Sep 2, 2011 at 6:36 PM, aditya kumar >>> > > wrote: >>> > >>> > > > their wont be any conflict in ip address . coz within dhcp assigns >>> ip >>> > > > adsress from the pool of available address and within the n/w (LAN) >>> we need >>> > > > to have unique ip address bt across the n/w (LAN) we can use same >>> ip from >>> > > > the pool of ip addresses . >>> > >>> > > > On Sat, Sep 3, 2011 at 1:56 AM, sagar pareek < >>> sagarpar...@gmail.com>wrote: >>> > >>> > > >> It is urgent to get the answer thats why i m posting network >>> question >>> > > >> here... searching on net is not working >>> > >>> > > >> HI !! >>> > > >> I stuck on a question related to VLSM >>> > >>> > > >> Suppose we have two subnets as >>> > >>> > > >> 10.0.1.0/24 valid ip address can be 10.0.1.2 >>> > >>> > > >> and >>> > >>> > > >> 10.0.1.0/26 here also valid ip address can be 10.0.1.2 >>> > >>> > > >> now suppose we are using these two subnets in a LAN and having >>> this ip >>> > > >> (10.0.1.2) in both the subnets then is there any IP conflict will >>> happen or >>> > > >> not? >>> > >>> > > >> -- >>> > > >> **Regards >>> > > >> SAGAR PAREEK >>> > > >> COMPUTER SCIENCE AND ENGINEERING >>> > > >> NIT ALLAHABAD >>> > >>> > > >> -- >>> > > >> You received this message because you are subscribed to the Google >>> Groups >>> > > >> "Algorithm Geeks" group. >>> > > >> To post to this group, send email to algogeeks@googlegroups.com. >>> > > >> To unsubscribe from this group, send email to >>> > > >> algogeeks+unsubscr...@googlegroups.com. >>> > > >> For more options, visit this group at >>> > > >>http://groups.google.com/group/algogeeks?hl=en. >>> > >>> > > > -- >>> > > > You received this message because you are subscribed to the Google >>> Groups >>> > > > "Algorithm Geeks" group. >>> > > > To post to this group, send email to algogeeks@googlegroups.com. >>> > > > To unsubscribe from this group, send email to >>> > > > algogeeks+unsubscr...@googlegroups.com. >>> > > > For more options, visit this group at >>> > > >http://groups.google.com/group/algogeeks?hl=en. >>
Re: [algogeeks] Re: Network Question
ok i know it will match longest mask...but then it will always skip the ip of shorter mast if it has same ip address On Sat, Sep 3, 2011 at 10:15 PM, sukran dhawan wrote: > ya the longest mask matching will take place > > > On Sat, Sep 3, 2011 at 9:17 PM, VIHARRI wrote: > >> I think the communication problem is just bcoz of longest prefix >> match... >> >> On Sep 3, 10:09 am, Vengadanathan wrote: >> > ya both the subnet can exisit in the same network , but problem is >> > lack of communication between the two subnets ,because in routing >> > table of the router the record for 10.0.1.0/26 will be first then >> > record for 10.0.1.0/24 will be , so 10.0.1.0/26 will be given first >> > preference , so subnet 10.0.1.0/26 cannot communicate with 10.0.1.0/24 >> > having same ip node more over packet sent within 10.0.1.0/24 will >> > reach 10.0.1.0/26 not to the nodes on the same network .. so >> > 10.0.1.0/24 can communicate with 10.0.1.0/26 >> > but cannot communicate within itself .. >> > >> > On Sep 3, 9:38 am, bharatkumar bagana >> > wrote: >> > >> > >> > >> > >> > >> > >> > >> > > all the addresses which come under second addr will also come under >> first >> > > >> > > Can those 2 be exist in same LAN ? >> > > If yes , how can router decides to which subnet it has to pass through >> the >> > > incoming packet .. >> > >> > > On Fri, Sep 2, 2011 at 6:36 PM, aditya kumar >> > > wrote: >> > >> > > > their wont be any conflict in ip address . coz within dhcp assigns >> ip >> > > > adsress from the pool of available address and within the n/w (LAN) >> we need >> > > > to have unique ip address bt across the n/w (LAN) we can use same ip >> from >> > > > the pool of ip addresses . >> > >> > > > On Sat, Sep 3, 2011 at 1:56 AM, sagar pareek > >wrote: >> > >> > > >> It is urgent to get the answer thats why i m posting network >> question >> > > >> here... searching on net is not working >> > >> > > >> HI !! >> > > >> I stuck on a question related to VLSM >> > >> > > >> Suppose we have two subnets as >> > >> > > >> 10.0.1.0/24 valid ip address can be 10.0.1.2 >> > >> > > >> and >> > >> > > >> 10.0.1.0/26 here also valid ip address can be 10.0.1.2 >> > >> > > >> now suppose we are using these two subnets in a LAN and having this >> ip >> > > >> (10.0.1.2) in both the subnets then is there any IP conflict will >> happen or >> > > >> not? >> > >> > > >> -- >> > > >> **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. >> > >> > > -- >> > >> > > **Please do not print this e-mail until urgent requirement. Go Green!! >> > > Save Papers <=> Save Trees >> > > *BharatKumar Bagana* >> > > **http://www.google.com/profiles/bagana.bharatkumar< >> http://www.google.com/profiles/bagana.bharatkumar> >> > > * >> > > Mobile +91 8056127652* >> > > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from 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] Re: Network Question
yeah the same problem i facing that if two same ip/s with diff subnets in same LAN can't create any problem?? On Sat, Sep 3, 2011 at 11:05 AM, bharatkumar bagana < bagana.bharatku...@gmail.com> wrote: > I didn't understand "so subnet 10.0.1.0/26 cannot communicate with > 10.0.1.0/24 > > having same ip node more over packet sent within 10.0.1.0/24 will > reach 10.0.1.0/26 not to the nodes on the same network .. so > 10.0.1.0/24 can communicate with 10.0.1.0/26 > but cannot communicate within itself .." > > what do u mean? > In a n/w all the IP 's should be unique ? can there exist like this .. pls > explain me detail y ... > > On Sat, Sep 3, 2011 at 1:09 AM, Vengadanathan wrote: > >> ya both the subnet can exisit in the same network , but problem is >> lack of communication between the two subnets ,because in routing >> table of the router the record for 10.0.1.0/26 will be first then >> record for 10.0.1.0/24 will be , so 10.0.1.0/26 will be given first >> preference , so subnet 10.0.1.0/26 cannot communicate with 10.0.1.0/24 >> having same ip node more over packet sent within 10.0.1.0/24 will >> reach 10.0.1.0/26 not to the nodes on the same network .. so >> 10.0.1.0/24 can communicate with 10.0.1.0/26 >> but cannot communicate within itself .. >> >> On Sep 3, 9:38 am, bharatkumar bagana >> wrote: >> > all the addresses which come under second addr will also come under >> first >> > >> > Can those 2 be exist in same LAN ? >> > If yes , how can router decides to which subnet it has to pass through >> the >> > incoming packet .. >> > >> > On Fri, Sep 2, 2011 at 6:36 PM, aditya kumar >> > wrote: >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > > their wont be any conflict in ip address . coz within dhcp assigns ip >> > > adsress from the pool of available address and within the n/w (LAN) we >> need >> > > to have unique ip address bt across the n/w (LAN) we can use same ip >> from >> > > the pool of ip addresses . >> > >> > > On Sat, Sep 3, 2011 at 1:56 AM, sagar pareek > >wrote: >> > >> > >> It is urgent to get the answer thats why i m posting network question >> > >> here... searching on net is not working >> > >> > >> HI !! >> > >> I stuck on a question related to VLSM >> > >> > >> Suppose we have two subnets as >> > >> > >> 10.0.1.0/24 valid ip address can be 10.0.1.2 >> > >> > >> and >> > >> > >> 10.0.1.0/26 here also valid ip address can be 10.0.1.2 >> > >> > >> now suppose we are using these two subnets in a LAN and having this >> ip >> > >> (10.0.1.2) in both the subnets then is there any IP conflict will >> happen or >> > >> not? >> > >> > >> -- >> > >> **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. >> > >> > -- >> > >> > **Please do not print this e-mail until urgent requirement. Go Green!! >> > Save Papers <=> Save Trees >> > *BharatKumar Bagana* >> > **http://www.google.com/profiles/bagana.bharatkumar< >> http://www.google.com/profiles/bagana.bharatkumar> >> > * >> > Mobile +91 8056127652* >> > >> >> -- >> You received this message beca
[algogeeks] Network Question
It is urgent to get the answer thats why i m posting network question here... searching on net is not working HI !! I stuck on a question related to VLSM Suppose we have two subnets as 10.0.1.0/24 valid ip address can be 10.0.1.2 and 10.0.1.0/26 here also valid ip address can be 10.0.1.2 now suppose we are using these two subnets in a LAN and having this ip (10.0.1.2) in both the subnets then is there any IP conflict will happen or not? -- **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] Pointer
Just refer indirect sorting...its just like what u guessed :) On Tue, Aug 30, 2011 at 11:33 PM, Nikhil Gupta wrote: > I read a question : To swap two given strings using pointers. > > Are we supposed to declare two pointers and exchange their values, or use > these pointers to swap each element of the two strings one by one? > > -- > Nikhil Gupta > NSIT, New Delhi, India > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: How to save a binary search tree space efficiently
level order traversal is best for this case :) On Sun, Aug 28, 2011 at 11:53 PM, prashant thorat wrote: > only preorder will suffice.. considering fact that it's BST > > > On Sun, Aug 28, 2011 at 11:26 PM, Rishabbh A Dua wrote: > >> Please correct me if i am wrong but isnt the answer to this q is AVL >> trees >> >> On Sun, Aug 28, 2011 at 10:43 PM, Dhriti Khanna wrote: >> >>> @ Navneet: See if the tree is: 6 >>>4 7 >>> 3 5 8 >>> >>> Then the preorder traversal is : 6 4 3 5 7 8 >>> And using this preorder traversal and inserting them in the tree one by >>> one, we generate this exact tree. >>> >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> >> >> -- >> Rishabbh A Dua >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > Yours affectionately, > Prashant Thorat > Computer Science and Engg. Dept, > NIT Durgapur. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- **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] Doubt
Success http://www.ideone.com/ZFgEh On Sun, Aug 28, 2011 at 3:13 PM, Aditya Virmani wrote: > it runs perfectly for me on both 64 bit & 32 bit... check again > > > On Sun, Aug 28, 2011 at 2:20 PM, Nikhil Gupta > wrote: > >> The following C program segfaults of IA-64, but works fine on IA-32. >> >> *int* main() >> >> { >> *int p; >> p *=* (*int)malloc(*sizeof*(*int*)); >> >> >> ***p *=* 10; >> *return* 0; >> >> >> } >> >> Why does it happen so? >> >> -- >> Nikhil Gupta >> Senior Co-ordinator, Publicity >> CSI, NSIT Students' Branch >> NSIT, New Delhi, India >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- **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] Adding Two no without using any operator...??
yeah one option is half adder with "xor" and "and" operators one more solution http://www.ideone.com/B07bn On Sun, Aug 28, 2011 at 12:41 AM, Gaurav Menghani wrote: > I guess you mean without using any 'arithmetic operator'. If yes, it > can be done with XOR and AND operators. > > Not sure how it can be done otherwise, without using any kind of > operators AT ALL. > > On Sun, Aug 28, 2011 at 12:37 AM, Brijesh > wrote: > > How to add two nos without using any operator...? > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Algorithm Geeks" group. > > To view this discussion on the web visit > > https://groups.google.com/d/msg/algogeeks/-/MpNKzlE3UuwJ. > > To post to this group, send email to algogeeks@googlegroups.com. > > To unsubscribe from this group, send email to > > algogeeks+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/algogeeks?hl=en. > > > > > > -- > Gaurav Menghani > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: String passing
@raj u already mentioned that if we write :- char *p="hello"; p[0]='k'; // gives runtime error so if we are passing arguments as modify(char a[],char *b) { . . } main() { . . modify("hello","hi"); . . } then its actually char arr[]="hello"; char *b="hi"; so ofcourse now b[0]='a'; // give u runtime error now u may be confuse about arr[0]='a'; //gives runtime error here i would like to tell you that arr is char pointer not char array you can check by yourself in :- http://www.ideone.com/EQrjj On Sat, Aug 27, 2011 at 10:39 PM, raj kumar wrote: > > "monsters are monsters" > > > > -- Forwarded message -- > From: raj kumar > Date: Sat, Aug 27, 2011 at 10:30 PM > Subject: Re: [algogeeks] Re: String passing > To: algogeeks@googlegroups.com > > > can't understand what are you trying to say > > source > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: Recruitment Procedure for Microsoft Research Redmond and Bangalore
Well i only attended MSR b'lore summer school but sorry no idea interns On Sat, Aug 27, 2011 at 7:23 PM, shady wrote: > anyone with research background ? > > > On Sat, Aug 27, 2011 at 1:57 AM, shady wrote: > >> Does anyone know about the recruitment procedure for Research Intern at MS >> Redmond or MS Bangalore ? What are the type of questions do they ask and >> what should be paid attention to ? >> There are lot of posts on MS SDE and SDET positions but none about >> research. >> >> If anyone knows then kindly reply. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Tejas Network Placement Process!!!
Yeah i wanna know abt it... On Fri, Aug 26, 2011 at 9:22 PM, rohit wrote: > Please share Process and experience of tejas Network for software > profile. > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: Remove all Duplicates Words
thanks ankur khurana @dave May be u never did any mistake in posting and reading the problems. But dont think urself superior. Yeah i did mistake in reading the question so u must either ignore it or request me to not repeat it in future. You are behaving like its my daily routine of doing such kind of things. On Thu, Aug 25, 2011 at 11:56 AM, Anup Ghatage wrote: > Actually, this method will be O(n) for any number of occurrences of a > single word, but It will go into O(n^2) for multiple occurrences of multiple > words. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: Find the non-duplicate element in sorted array in < O(n) time
mine approach is log(n) check it out first On Thu, Aug 25, 2011 at 1:21 AM, Don wrote: > I'm going to assume that "elements in pairs" means exactly two of each > element except for the one which is missing it's pair. > The recursive solution is simple, but it only uses tail recursion, so > it is worthwhile to do it iteratively. > > int findSingle(int *a, int size) > { > int result; > > while(1) > { >printf("a[0] = %d size=%d\n", a[0], size); >if (size == 1) >{ > result = a[0]; > break; >} >else if (size == 3) >{ >result = (a[0] == a[1]) ? a[2] : a[0]; >break; >} >else >{ > int midpoint = size/2; > if (a[midpoint] == a[midpoint-1]) --midpoint; > if (a[midpoint] != a[midpoint+1]) > { >result = a[midpoint]; >break; > } > else if (midpoint % 2) > { >size = midpoint; > } > else > { >a += midpoint; >size -= midpoint; > } >} > } > return result; > } > > On Aug 24, 4:49 am, atul purohit wrote: > > Hi, > > > > A* sorted *integer array contains elements in pairs. All the pairs are > > complete except one element whose pair is missing. Find that element. > > > > Ex. { 1,1,2,2,2,2,3,3,4,5,5} > > result = 5 > > > > There is a standard solution which returns an XOR of all the elements. > But > > this needs O(n) time complexity. The person who asked me this question > said > > that this can be done in < O(n). Maybe we can eliminate some elements. > > Anyone knows how to do this? > > > > Cheers, > > Atul > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: Find the non-duplicate element in sorted array in < O(n) time
> > >> > Atul >>> > >>> > >> -- >>> > >> You received this message because you are subscribed to the Google >>> Groups >>> > >> "Algorithm Geeks" group. >>> > >> To post to this group, send email to algogeeks@googlegroups.com. >>> > >> To unsubscribe from this group, send email to >>> > >> algogeeks+unsubscr...@googlegroups.com. >>> > >> For more options, visit this group at >>> > >>http://groups.google.com/group/algogeeks?hl=en. >>> > >>> > > -- >>> > > The more you sweat in the field, the less you bleed in war." >>> > >>> > > Ankit Minglani >>> > > NITK Surathkal >>> > >>> > > -- >>> > > You received this message because you are subscribed to the Google >>> Groups >>> > > "Algorithm Geeks" group. >>> > > To post to this group, send email to algogeeks@googlegroups.com. >>> > > To unsubscribe from 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. > -- **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] Remove all Duplicates Words
use hashing On Wed, Aug 24, 2011 at 8:43 PM, UMESH KUMAR wrote: > Qn. Remove all duplicates words from given a line without using extra > memory ? > > Ex:-Hello word hello hi > Out put:- Hello word hi > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: C doubt
See if we use dynamic memory allocation then still the size of pointer will be 4 bytes only Mean that int* pointer still have the size equals to pointer ... malloc only returns new alloted memory which is now only *pointed *by that pointer check this out :- http://www.ideone.com/20ayq On Wed, Aug 24, 2011 at 8:10 PM, Don wrote: > If you are working in C++, stl has a vector container class which will > do this. Otherwise, declare an integer pointer in the struct and use > malloc to allocate memory for it. Then you can use it like an array. > Don > > On Aug 23, 11:51 pm, Arun Vishwanathan wrote: > > say that you have a structure with some fields of known size and unknown > > size.For example, a char, an integer and an integer array.I do not know > the > > size of the integer array until the user mentions the number of bytes he > > needs this integer array to cover in the command line as an argument.Is > it > > possible to have a structure with an integer dynamic array? > > > > Arun > > > > -- > > "People often say that motivation doesn't last. Well, neither does > bathing > > - that's why we recommend it daily." > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- **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] Re: Search an array of unknown length
hmm ok my mistake of reading On Tue, Aug 23, 2011 at 6:56 PM, saurabh singh wrote: > Well sir I am fully aware why this is hapening.Kindly reread what I wrote > .*"what if we are given only the address of the array".* > I personaly feel anyone who asked the question never expected this to be > the answer.(using sizeof). > On Tue, Aug 23, 2011 at 2:42 PM, sagar pareek wrote: > >> @saurabh >> u are getting sizeof(a)/sizeofa[0] =1 coz fiest one is pointer and second >> one is integer...both's size is 4 >> do it >> without passing >> http://www.ideone.com/8olTP >> >> >> On Tue, Aug 23, 2011 at 1:28 PM, vikas wrote: >> >>> nopes, you need to know where the hell it ends even if this is a >>> string , it ends with convention of ending 0. in case it is stream , >>> we know the data length. in case of array, above mentioned approach >>> should work. sizeof(arr)/sizeof(arr[0]) >>> >>> if you are given only a pointer and no length, you can address until >>> there is another page starts in memory , not belonging to the process. >>> >>> >>> >>> >>> On Aug 23, 7:07 am, saurabh singh wrote: >>> > Just a small code to back up my point...http://www.ideone.com/woRiT >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > On Tue, Aug 23, 2011 at 7:33 AM, saurabh singh >>> wrote: >>> > > That would take all the fun awaywhat if you are given only the >>> address >>> > > of the array?This wont work in that case >>> > >>> > > On Mon, Aug 22, 2011 at 10:39 PM, asdqwe >>> wrote: >>> > >>> > >> If i am not wrong, the only possible solution can be >>> > >> len=sizeof(arr)/sizeof(arr[0]) >>> > >> i.e. find the length from the array itself. >>> > >>> > >> On Aug 22, 9:01 pm, saurabh singh wrote: >>> > >> > @dave or anyone??? response please >>> > >>> > >> > On Sun, Aug 21, 2011 at 12:43 PM, saurabh singh < >>> saurab...@gmail.com> >>> > >> wrote: >>> > >> > > kkk...not sure >>> > >> > > assume no number is greater than 1000(I mentioned There has to >>> be some >>> > >> > > additional constraints to make the problem solvable) >>> > >> > > Now check 1st element if not the desired element keep >>> multiplying with >>> > >> 2 >>> > >> > > the previous range till either one of these condition is >>> satisfied >>> > >> > > *1.An exception is caught* >>> > >> > > *2.Number greater than 1000 occurs.* >>> > >> > > suppose this happens for *1024 *for the given example. >>> > >> > > then we will check out for (512+1024)/2 th element for the above >>> > >> condition. >>> > >> > > If true than again branch like binary search.This way can >>> element >>> > >> which on >>> > >> > > left side doesn't gives any exception and maintains the >>> constraints >>> > >> while on >>> > >> > > the right it violates the same.So we may land up with the >>> desired >>> > >> index and >>> > >> > > can then perform binary search... >>> > >>> > >> > > PS:There are lots of assumption in this approach and the more I >>> write >>> > >> the >>> > >> > > more I get convinced that its a plain stupid idea... >>> > >>> > >> > > -- >>> > >> > > Saurabh Singh >>> > >> > > B.Tech (Computer Science) >>> > >> > > MNNIT ALLAHABAD >>> > >>> > >> > -- >>> > >> > Saurabh Singh >>> > >> > B.Tech (Computer Science) >>> > >> > 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 emai
Re: [algogeeks] Re: amazon q
I m surprised that ur whole explanation is for me :-o Check ur previous post and then last post... i think u r confused On Tue, Aug 23, 2011 at 3:10 PM, WgpShashank wrote: > @sagar, > > A self-balancing balancing binary search tree(Its *BST not BT )*containing n > items allows the lookup, insertion, and removal of an item in > O(log n) worst-case time. Since it’s a BST, we can easily find out minimum > element in O(nlogn). please note that if it would have been simple BST not > Balnced BST then our complexity to lookup will changes to O(n) in worst case > when tree is skewed but as question say balanced BST (check out AVL/RB Tree) > they gureentte that look-up will O(logn) only why its true & will work you > need to go through tree rotation (thats used to make tree balanced & reduce > height ). > > Since Heap is a balanced binary tree (or almost complete binary tree but > not balanced BST ), insertion complexity for heap is O(logn). Also > complexity to get minimum in a min heap is O(logn) because removal of root > node causes a call to > heapify<http://www.cs.virginia.edu/%7Eluebke/cs332.fall00/lecture4/index.htm>(after > removing the first element from the array) to maintain the heap tree > property. But a heap cannot be used for the above purpose as the question > says – insert an element if it is not already present because of this > constraint we can't use min-heap as well . For a heap, we cannot find out in > O(logn) if an element is present or not as its balanced Binary Tree(BT) , we > have to search all the elements e.g.in both left & right sub-tree up-to > leaf so in worst case it will take O(n) time to search an element weather > ist present or not , then its present leave it else insert as a last node & > call heapify (take O(logn)) so tottal time complexity will be O(n)+ O(logn) > =O(n) > > search+heapify =O(search) > > so why correct answer is only Balanced Binary Search Tree > > Do Notify me if i missed something or wants more clarification ? > > > *Thanks > Shashank Mani > Computer Science > Birla Institute of Technology Mesra* > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/algogeeks/-/65k0xGJY6ZoJ. > > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: Search an array of unknown length
@saurabh u are getting sizeof(a)/sizeofa[0] =1 coz fiest one is pointer and second one is integer...both's size is 4 do it without passing http://www.ideone.com/8olTP On Tue, Aug 23, 2011 at 1:28 PM, vikas wrote: > nopes, you need to know where the hell it ends even if this is a > string , it ends with convention of ending 0. in case it is stream , > we know the data length. in case of array, above mentioned approach > should work. sizeof(arr)/sizeof(arr[0]) > > if you are given only a pointer and no length, you can address until > there is another page starts in memory , not belonging to the process. > > > > > On Aug 23, 7:07 am, saurabh singh wrote: > > Just a small code to back up my point...http://www.ideone.com/woRiT > > > > > > > > > > > > > > > > > > > > On Tue, Aug 23, 2011 at 7:33 AM, saurabh singh > wrote: > > > That would take all the fun awaywhat if you are given only the > address > > > of the array?This wont work in that case > > > > > On Mon, Aug 22, 2011 at 10:39 PM, asdqwe > wrote: > > > > >> If i am not wrong, the only possible solution can be > > >> len=sizeof(arr)/sizeof(arr[0]) > > >> i.e. find the length from the array itself. > > > > >> On Aug 22, 9:01 pm, saurabh singh wrote: > > >> > @dave or anyone??? response please > > > > >> > On Sun, Aug 21, 2011 at 12:43 PM, saurabh singh < > saurab...@gmail.com> > > >> wrote: > > >> > > kkk...not sure > > >> > > assume no number is greater than 1000(I mentioned There has to be > some > > >> > > additional constraints to make the problem solvable) > > >> > > Now check 1st element if not the desired element keep multiplying > with > > >> 2 > > >> > > the previous range till either one of these condition is satisfied > > >> > > *1.An exception is caught* > > >> > > *2.Number greater than 1000 occurs.* > > >> > > suppose this happens for *1024 *for the given example. > > >> > > then we will check out for (512+1024)/2 th element for the above > > >> condition. > > >> > > If true than again branch like binary search.This way can element > > >> which on > > >> > > left side doesn't gives any exception and maintains the > constraints > > >> while on > > >> > > the right it violates the same.So we may land up with the desired > > >> index and > > >> > > can then perform binary search... > > > > >> > > PS:There are lots of assumption in this approach and the more I > write > > >> the > > >> > > more I get convinced that its a plain stupid idea... > > > > >> > > -- > > >> > > Saurabh Singh > > >> > > B.Tech (Computer Science) > > >> > > MNNIT ALLAHABAD > > > > >> > -- > > >> > Saurabh Singh > > >> > B.Tech (Computer Science) > > >> > 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. > > > > > -- > > > Saurabh Singh > > > B.Tech (Computer Science) > > > MNNIT ALLAHABAD > > > > -- > > Saurabh Singh > > B.Tech (Computer Science) > > MNNIT ALLAHABAD > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- **Regards 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] C output
Yeah its o/p is 10 :) On Tue, Aug 23, 2011 at 12:45 AM, Deepak Garg wrote: > its output is > > 10 > > > On Tue, Aug 23, 2011 at 12:03 AM, rohit wrote: > >> #include >> >> #define max(a,b) (a>b?a:b) >> >> >> int main() >> { >> >> int j=max(3+2,2+8); >> printf("%d",j); >> >>return 0; >> } >> >>why this program show output as 9 ? please help me >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > > > -- > U.D.I.T > > Sent by Nokia OVI (c) > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re:
it gives runtime error... coz u have to allocate memory to *q On Tue, Aug 23, 2011 at 12:02 AM, Abhishek wrote: > i think.. it will not produce error, but o/p 'may' be garbage values. > since the memory locations adjacent to *q will be overwritten. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/algogeeks/-/X1CZmpVjhxEJ. > > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Please share experiences if any body has faced Samsung Engineering Labs(SIEL)
one more thing simple questions on OS in interview very basic like what is process? diff b/w process and threads why thread call light process ... On Mon, Aug 22, 2011 at 11:15 PM, sonu kumar wrote: > aptitude test as sagar said.then tech test consists of > c- 20 ques, > ds-5 ques, > os- 5 ques. > > then in interview only c and c++,and ds asked. > they mostly emphasize on code 2 write. > > > On Mon, Aug 22, 2011 at 2:08 PM, saurabh wrote: > >> Can Please tell about the type of question if any body has faced >> SIEL . >> >> Saurabh sah >> NIT Jaipur. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] constructor ques
+1 coder On Mon, Aug 22, 2011 at 9:41 PM, sukran dhawan wrote: > hey sorry didnt notice virtual :) > > > On Mon, Aug 22, 2011 at 9:38 PM, coder dumca wrote: > >> @sukran ur r wrong man >> the construdor of virtual base class are called first otherwise it is >> from left to right >> so the correct order is >> D A B C Z >> On Mon, Aug 22, 2011 at 8:25 AM, Sanjay Rajpal wrote: >> >>> agree with sukran. >>> >>> >>> Sanju >>> :) >>> >>> >>> >>> On Mon, Aug 22, 2011 at 8:20 AM, sukran dhawan >>> wrote: >>> >>>> its left to right always ! >>>> >>>> >>>> On Mon, Aug 22, 2011 at 8:49 PM, Sanjay Rajpal wrote: >>>> >>>>> A >>>>> B >>>>> C >>>>> D >>>>> >>>>> >>>>> Sanju >>>>> :) >>>>> >>>>> >>>>> >>>>> On Mon, Aug 22, 2011 at 8:17 AM, sivaviknesh s >>>> > wrote: >>>>> >>>>>> you have 4 classes A,B,C,D and class Z is derived from all these >>>>>> classes >>>>>> using >>>>>> Class Z: public A,private B,Protected C, Virtual D >>>>>> What is the order of constructor call? >>>>>> >>>>>> ...plz reason out also >>>>>> >>>>>> -- >>>>>> Regards, >>>>>> $iva >>>>>> >>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "Algorithm Geeks" group. >>>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>>> To unsubscribe from this group, send email to >>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>> For more options, visit this group at >>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>> >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Algorithm Geeks" group. >>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>> To unsubscribe from this group, send email to >>>>> algogeeks+unsubscr...@googlegroups.com. >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algogeeks@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> algogeeks+unsubscr...@googlegroups.com. >>>> For more options, visit this group at >>>> http://groups.google.com/group/algogeeks?hl=en. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Please share experiences if any body has faced Samsung Engineering Labs(SIEL)
50 apti (25 DI + 25 reasoning) in 60 mis 20 tech 30 mins 1tech + 1 hr and u are done On Mon, Aug 22, 2011 at 9:36 PM, ghsjgl k wrote: > i attended for SISO > > > On Mon, Aug 22, 2011 at 2:08 PM, saurabh wrote: > >> Can Please tell about the type of question if any body has faced >> SIEL . >> >> Saurabh sah >> NIT Jaipur. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Output question
U should know that union's elements share memory alloted through the largest data type like in this case 10 bytes is alloted and is shared by all the union elements. So in union x :- last element modified is c, so that's why it is printing garbage values for int and char[] elements... actually if u convert float value in binary then u will see that what's its actual integer value is? same case for char[] in union y : last modified element is integer thats y it is printing 100 for integer... ascii value of 'd' is 100 thats y printing 'd' for char[] and 0.000 for float On Mon, Aug 22, 2011 at 4:53 PM, vartika wrote: > #include > #include > int main() > { > typedef union > { > int a; > char b[10]; > float c; > } > Union; > > Union x,y = {100}; > x.a = 50; > strcpy(x.b,"hello"); > x.c = 21.50; > > printf("Union x : %d %s %f \n",x.a,x.b,x.c ); > printf("Union y :%d %s%f \n",y.a,y.b,y.c); > return 0; > } > > Someone pls explain the output > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: amazon q
@shashank what about min heap? Check this out --> http://en.wikipedia.org/wiki/Heap_%28data_structure%29 On Mon, Aug 22, 2011 at 4:13 PM, WgpShashank wrote: > Only Balanced BST (its guaranteed that we can search element in o(logn) , > > i am assuming its maxheap .In a max heap, the smallest element is always > present at a leaf node. So we need to check for all leaf nodes for the > minimum value. Worst case complexity will be O(n) > > 12 > / \ > / \ > 8 7 > / \ / \ try to search 5 in this using Heap & balanced BST > / \ / \ > 2 3 4 5 > > As searching is main constraints on complexity we can't use Heap to achieve > O(logn) it will take linear time but using Balanced BST (e.g. AVL/RB Tree) > we can search element in O(logn) :) > > > Shashank > CSE,BIT Mesra > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/algogeeks/-/fmXlF2-kcFwJ. > > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Adobe Interview - 20/08/2011
@saurabh pls post ur solutions too On Mon, Aug 22, 2011 at 12:48 PM, Jagannath Prasad Das wrote: > i think find max and min of all time-stamps respectively > > > On Mon, Aug 22, 2011 at 12:44 PM, saurabh agrawal wrote: > >> How did u solved : >> >> 3) There is a list containing the checkin and checkout time of every >> person in a party . The checkin time is in ascending order while the >> checkout is random . >> >> Eg: >> >>Check_inCheck_out >> >> Person 1 8.00 9.00 >> >> Person 2 8.15 8.30 >> >> Person 3 8.30 9.20 >> >> >> >> On Mon, Aug 22, 2011 at 9:14 AM, Decipher wrote: >> >>> Hi, >>> >>> This is my Adobe interview experience for freshers : >>> >>> *Written Test:* >>> >>> Engineering – 45 Minutes - Data Structures, Algorithms, >>> Operating Systems >>> >>> C/C++ – 45 Minutes - C/C++ Fundamentals & Coding*** >>> * >>> >>> Aptitude– 45 Minutes – Quantitative & Analytical >>> >>> * * >>> >>> *On clearing the Test, 3 Technical Interviews + HR discussion on the >>> same day.* >>> >>> * >>> * >>> >>> *Interview 1: * >>> >>> 1) Insert an element in a linked list at the end , given the *start * >>> pointer. >>> >>> 2) Write a function to Swap pointers . >>> >>> 3) There is a list containing the checkin and checkout time of every >>> person in a party . The checkin time is in ascending order while the >>> checkout is random . >>> >>> Eg: >>> >>>Check_inCheck_out >>> >>> Person 1 8.00 9.00 >>> >>> Person 2 8.15 8.30 >>> >>> Person 3 8.30 9.20 >>> >>> and so on ... >>> Now , give an optimized solution to find at what time the maximum number >>> of people will be in the party . My solution - O(nlogn) time and O(n) space >>> . He gave another O(nlogn) time and O(n) space solution . >>> >>> and some other questions that I can't recal .. >>> >>> *Interview 2:* >>> 1) Base class contains 2 functions and Derived class (with Private >>> Inheritance from Base) also contains 2 functions (same name as those in Base >>> cass), then he asked me the effect by changing the Inheritance type and >>> making different functions virtual like - virtual func in Base then in >>> Derived and then both . >>> >>> 2) Same question appended- A derived class *A* derived from Derived and >>> Base , now >>> >>> A a = new A; >>> Base *b = a; >>> Derived *d = a; >>> >>> b = d; >>> >>> and b = (Base *) d; >>> >>> then which functions can I call ? >>> >>> 3) Convert a tree into its mirror without using extra memory - O(1) space >>> . >>> >>> 4) If an array is rotated a number of unknown times , then how to find an >>> element in O(log n) >>> >>> 5) There are 3 sticks placed at right angles to each other and a sphere >>> is placed between the sticks . Now another sphere is placed in the gap >>> between the sticks and Larger sphere . Find the radius of smaller sphere in >>> terms of radius of larger sphere . >>> >>> *This is as far I can remember so please don't ask any questions >>> regarding it .* >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/algogeeks/-/K0ws20ht-pkJ. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from 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] Re: amazon q
Ok then answer must be both of them :) actually finding min is O(1) but to re-heapify after deletion is log(n). On Mon, Aug 22, 2011 at 9:55 AM, Amol Sharma wrote: > BST should be the answer..agree with the reason by dumanshu > -- > > > Amol Sharma > Third Year Student > Computer Science and Engineering > MNNIT Allahabad > <http://gplus.to/amolsharma99> > <http://twitter.com/amolsharma99><http://in.linkedin.com/pub/amol-sharma/21/79b/507><http://youtube.com/amolsharma99> > > > > > > On Mon, Aug 22, 2011 at 6:52 AM, Akash Mukherjee wrote: > >> ay that the "re-heapify" is implicit just as the "re-balance" is im > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] SAP!!
I don't think that SAP came anywhere in north campuses !! as far as i know... On Sun, Aug 21, 2011 at 9:29 PM, rashmi i wrote: > Kamakshi, do u have any idea about the SAP placement questions? > > > On Sun, Aug 21, 2011 at 9:28 PM, rashmi i wrote: > >> Cummins College, Pune. >> >> >> On Sun, Aug 21, 2011 at 9:16 PM, Kamakshii Aggarwal < >> kamakshi...@gmail.com> wrote: >> >>> which college? >>> >>> On Sun, Aug 21, 2011 at 8:56 PM, rashmi i wrote: >>> >>>> >>>> Hey, SAP is visiting our college. Any idea about the pattern of the >>>> campus selection process? As in type of questions asked? Thanks >>>> -- >>>> R@$!-! >>>> "DoN'T LimIt Ur cHaLlEngeS, ChAlLenGe uR LImItS." >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algogeeks@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> algogeeks+unsubscr...@googlegroups.com. >>>> For more options, visit this group at >>>> http://groups.google.com/group/algogeeks?hl=en. >>>> >>> >>> >>> >>> -- >>> Regards, >>> Kamakshi >>> kamakshi...@gmail.com >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> >> >> -- >> R@$!-! >> "DoN'T LimIt Ur cHaLlEngeS, ChAlLenGe uR LImItS." >> > > > > -- > R@$!-! > "DoN'T LimIt Ur cHaLlEngeS, ChAlLenGe uR LImItS." > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: amazon q
+1 Dumanshu This question was asked by amazon :D And answer is BST only coz deletion in heap(min heap) is O(1). And if it is max heap then deletion of min element is O(n). On Sun, Aug 21, 2011 at 9:13 PM, Dumanshu wrote: > We can't use a heap. Balanced BST is correct because "Deletion of the > smallest element Insertion of an > element if it is not already present in the set" -> for this we need > to search for the element and searching in heap is O(n). > > On Aug 21, 6:16 pm, priya ramesh > wrote: > > A data structure is required for storing a set of integers such that each > of > > the following operations can be done in (log n) time, where n is the > number > > of elements in the set. Deletion of the smallest element Insertion of an > > element if it is not already present in the set Which of the following > data > > structures can be used for this purpose? > > > > · Pick one of the choices > > > > A heap can be used but not a balanced binary search tree > > > > A balanced binary search tree can be used but not a heap > > > > Both balanced binary search tree and heap can be used > > > > Neither balanced binary search tree nor heap can be used > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Longest palindrome
Suggest a method to find longest palindrome in a given string.. -- **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] Re: c question what is output?
Arey yaar just see the my post... i explained it step by step :) On Sun, Aug 21, 2011 at 4:43 PM, Sanjay Rajpal wrote: > 16 > > 8*(8-1*(8-1-1)) > > > Sanju > :) > > > > On Sun, Aug 21, 2011 at 4:10 AM, Anjul Sharma wrote: > >> is 336 the answer?? >> >> On Aug 21, 11:10 am, SuDhir mIsHra wrote: >> > #include >> > #define FUNC1(i) (i*(i-1)) >> > #define FUNC2(i) (i==0?1:i*FUNC1(i-1)) >> > main() >> > { >> > int i=8; >> > >> > printf("\n%d",FUNC2(i)); >> > >> > >> > >> > >> > >> > >> > >> > } >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] why the output 16
@prakash before posting u should check what others already posted :D :D On Sun, Aug 21, 2011 at 4:03 PM, Prakash D wrote: > FUNC2(8) > > ==> 8==0? 1: 8 * FUNC1(8-1) > ==> 8==0? 1: 8*( 8-1* 8-1-1) > > ==> 8 * (8-8-2) > ==> -16 > > but why 16?? > > On Sat, Aug 20, 2011 at 7:02 PM, SuDhir mIsHra > wrote: > >> #include >> #define FUNC1(i) (i*(i-1)) >> #define FUNC2(i) (i==0?1:i*FUNC1(i-1)) >> main() >> { >> int i=8; >> >> >> printf("\n%d",FUNC2(i)); >> } >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] c question what is output?
FUNC2(i) = i==0?i*(i-1*(i-1-1)) 8==0?1:8*(8-1*(8-1-1)) 8==0?1:8*(8-6) 8==0?1:8*2 8==0?1:16 hence it will return 16 On Sun, Aug 21, 2011 at 11:40 AM, SuDhir mIsHra wrote: > #include > #define FUNC1(i) (i*(i-1)) > #define FUNC2(i) (i==0?1:i*FUNC1(i-1)) > main() > { > int i=8; > > > printf("\n%d",FUNC2(i)); > } > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- **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] why the output 16
FUNC2(i) = i==0?i*(i-1*(i-1-1)) 8==0?1:8*(8-1*(8-1-1)) 8==0?1:8*(8-6) 8==0?1:8*2 8==0?1:16 hence it will return 16 On Sat, Aug 20, 2011 at 7:02 PM, SuDhir mIsHra wrote: > #include > #define FUNC1(i) (i*(i-1)) > #define FUNC2(i) (i==0?1:i*FUNC1(i-1)) > main() > { > int i=8; > > > printf("\n%d",FUNC2(i)); > } > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- **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] array problem
This problem can be reduced if we are taking whole 32 bits... Mean left most all 0's bits are also including then if number is less than 65535 (2^16-1) then make it 0 as 16 bits are at least zero in this case On Sun, Aug 21, 2011 at 2:19 PM, Sanjay Rajpal wrote: > let n be the no.of integers in the array : > > int i=1,a; > int zero,one; > for(int a=1;a<=32;a++) > { > zero=0; > one=0; > for(int j=0;j { > if(a[j] & i) > { > one++; > } > else > { > zero++; > } > } > if(one > zero) > { > printf("1s are more \n"); > } > else > { > printf("0s are more \n"); > } > i=i<<1; > } > > Correct me if m wrong. > > Sanju > :) > > > > On Sun, Aug 21, 2011 at 1:28 AM, Dheeraj Sharma < > dheerajsharma1...@gmail.com> wrote: > >> yeah i took it in the another way..i ll post it v soon >> >> On 8/21/11, himanshu kansal wrote: >> > problem: There is an array containing integers. >> > for every bit in the integer,you have to print a 1 if no of 1s >> > corresponding to that bit is more than no of 0s corresponding to that >> > bit (counting that bit in all the integers) otherwise print a 0(if no >> > of 0s corresponding to that bit are more). >> > >> > this you have to do for all bits in the integers. >> > >> > assumption:integers are of 32bits. >> > no of integers in array are odd...(i.e. there is no case like no. of >> > 1s=no. of 0s) >> > >> > i have done this by counting the no of 1s and 0s for all bits. >> > >> > but can anyone suggest any other efficient approach (somewhat using >> > bitwise operators). >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Algorithm Geeks" group. >> > To post to this group, send email to algogeeks@googlegroups.com. >> > To unsubscribe from 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 >> +91 8950264227 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from 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] Number of nodes at each level in binary tree
and total number of nodes( leaves+internal ) present in a ith level tree is 2^(i+1)-1 On Sun, Aug 21, 2011 at 1:28 AM, sagar pareek wrote: > 2(power)i or 2^i > where i is level i=0,1,2,3.. > > > On Sun, Aug 21, 2011 at 1:27 AM, bugaboo wrote: > >> Anyone knows the algorithm to count the number of nodes at each level >> in a binary tree. Providing the approach and logic better than the >> actual code itself. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from 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 > > -- **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] Number of nodes at each level in binary tree
2(power)i or 2^i where i is level i=0,1,2,3.. On Sun, Aug 21, 2011 at 1:27 AM, bugaboo wrote: > Anyone knows the algorithm to count the number of nodes at each level > in a binary tree. Providing the approach and logic better than the > actual code itself. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Sorting
Ok u mean indirect sort ? In other words sort it in your mind ( in computer case sort it using references ) and then place them accordingly ( In computer case deference them just like in case of long strings sorting ? ) On Sun, Aug 21, 2011 at 12:38 AM, Aditya Virmani wrote: > use the references, sort it & then move the statues. no intermediate > moves...like it shudnt be.moving a to b & then to c... > > > On Sun, Aug 21, 2011 at 12:33 AM, sagar pareek wrote: > >> I am just asking what actual solution wants to convey? >> >> >> On Sun, Aug 21, 2011 at 12:32 AM, sagar pareek wrote: >> >>> *The statues are >>> very heavy and you want to move them the least possible distance.* >>> >>> On Sun, Aug 21, 2011 at 12:31 AM, priya ramesh < >>> love.for.programm...@gmail.com> wrote: >>> >>>> in quick sort the pivot is positioned to it's proper position. (no >>>> intermediate swaps) >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algogeeks@googlegroups.com. >>>> To unsubscribe from 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 >>> >>> >> >> >> -- >> **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.
Re: [algogeeks] Sorting
I am just asking what actual solution wants to convey? On Sun, Aug 21, 2011 at 12:32 AM, sagar pareek wrote: > *The statues are > very heavy and you want to move them the least possible distance.* > > On Sun, Aug 21, 2011 at 12:31 AM, priya ramesh < > love.for.programm...@gmail.com> wrote: > >> in quick sort the pivot is positioned to it's proper position. (no >> intermediate swaps) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from 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 > > -- **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] Sorting
*The statues are very heavy and you want to move them the least possible distance.* On Sun, Aug 21, 2011 at 12:31 AM, priya ramesh < love.for.programm...@gmail.com> wrote: > in quick sort the pivot is positioned to it's proper position. (no > intermediate swaps) > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: crossing a bridge; running away from zombies (logic puzzle)
:D On Sun, Aug 21, 2011 at 12:30 AM, Aditya Virmani wrote: > :D just sayin mahn...bura mat maan :D > > On Sun, Aug 21, 2011 at 12:23 AM, sagar pareek wrote: > >> @aditya >> Any puzzle asked by any company doesn't mean that it belongs to that >> particular company. >> >> I encounter this question first time in 2005 through a flash game. >> >> On Sun, Aug 21, 2011 at 12:17 AM, Aditya Virmani < >> virmanisadi...@gmail.com> wrote: >> >>> thts a Google question...17 is the answer >>> >>> >>> On Sat, Aug 20, 2011 at 2:08 AM, Dave wrote: >>> >>>> @Icy: A few years ago this was reported to be a Microsoft interview >>>> question. It is so well publicized now that most people here have >>>> probably seen it. >>>> >>>> 1 and 2 cross. >>>> 1 returns. (alternatively, 2 returns) >>>> 5 and 10 cross. >>>> 2 returns. (alternatively, 1 returns) >>>> 1 and 2 cross. >>>> >>>> 17 minutes. >>>> >>>> Dave >>>> >>>> On Aug 19, 3:25 pm, "icy`" wrote: >>>> > Hey everyone, >>>> > I recently joined this group, so I thought I'd add a short interview/ >>>> > logic puzzle that I remember hearing. Hopefully it wasnt already >>>> > said. Part of the fun is the story, so here it goes... >>>> > >>>> > Four people have been running away from a pack of zombies, and are now >>>> > injured in varying degrees. It is already nighttime, and they have >>>> > come upon a bridge. They must cross the bridge as fast as possible >>>> > before the pack of zombies comes upon them, but the bridge is very >>>> > dark, slippery, and cannot support much weight. There is one >>>> > flashlight. Rules: >>>> > >>>> > * the bridge must be crossed with the flashlight, only two people at >>>> > most. A return trip must be made (the flashlight cannot be thrown >>>> > back, etc) >>>> > * the four people cross the bridge at different speeds: 1minute, 2 >>>> > minutes, 5 min, and 10min. A trip time is determined by the slowest >>>> > person. So if the 1min crosses together with the 5min, the trip time >>>> > is 5min. >>>> > *if a person falls off the bridge, he/she goes to /dev/null;P >>>> > >>>> > So what is the fastest way for everyone to cross the bridge, and how >>>> > long does that take? >>>> > >>>> > ~icy >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algogeeks@googlegroups.com. >>>> To unsubscribe from 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.
Re: [algogeeks] Re: crossing a bridge; running away from zombies (logic puzzle)
@aditya Any puzzle asked by any company doesn't mean that it belongs to that particular company. I encounter this question first time in 2005 through a flash game. On Sun, Aug 21, 2011 at 12:17 AM, Aditya Virmani wrote: > thts a Google question...17 is the answer > > > On Sat, Aug 20, 2011 at 2:08 AM, Dave wrote: > >> @Icy: A few years ago this was reported to be a Microsoft interview >> question. It is so well publicized now that most people here have >> probably seen it. >> >> 1 and 2 cross. >> 1 returns. (alternatively, 2 returns) >> 5 and 10 cross. >> 2 returns. (alternatively, 1 returns) >> 1 and 2 cross. >> >> 17 minutes. >> >> Dave >> >> On Aug 19, 3:25 pm, "icy`" wrote: >> > Hey everyone, >> > I recently joined this group, so I thought I'd add a short interview/ >> > logic puzzle that I remember hearing. Hopefully it wasnt already >> > said. Part of the fun is the story, so here it goes... >> > >> > Four people have been running away from a pack of zombies, and are now >> > injured in varying degrees. It is already nighttime, and they have >> > come upon a bridge. They must cross the bridge as fast as possible >> > before the pack of zombies comes upon them, but the bridge is very >> > dark, slippery, and cannot support much weight. There is one >> > flashlight. Rules: >> > >> > * the bridge must be crossed with the flashlight, only two people at >> > most. A return trip must be made (the flashlight cannot be thrown >> > back, etc) >> > * the four people cross the bridge at different speeds: 1minute, 2 >> > minutes, 5 min, and 10min. A trip time is determined by the slowest >> > person. So if the 1min crosses together with the 5min, the trip time >> > is 5min. >> > *if a person falls off the bridge, he/she goes to /dev/null;P >> > >> > So what is the fastest way for everyone to cross the bridge, and how >> > long does that take? >> > >> > ~icy >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Sorting
Hi every one:- I encounter a problem in which we have to sort. You come across a collection of 20 stone statues in a line. You want to sort them by height, with the shortest statue on the left. The statues are very heavy and you want to move them the least possible distance. Design a sorting algorithm that minimizes the total distance that the statues are moved. Answer :- Whenever the swap operation for the objects being sorted is expensive, one of the best things to do is indirect sort, i.e., sort references to the objects first and then apply the permutation that was applied to the references in the end. In the case of statues, we can assign increasing indices to the statues from left to right and then sort the pairs of statue height and index. The indices in the sorted pairs would give us the permutation to apply. While applying permutation, we would want to perform it in a way that we move each statue the minimum possible distance. We can achieve this if each statue is moved exactly to its correct destination exactly once (no intermediate swaps). * I am not getting the answer...please anyone explain it... Thanks in advance :) :)* -- **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] Aricent
Well yeah its a development company but my seniors haven't got their joining yet. :( :( On Sat, Aug 20, 2011 at 11:54 PM, Abhishek wrote: > is 'Aricent' is a good company to join.. > > > Regards > BIT Mesra > MCA (III year) > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/algogeeks/-/vWqY79gxSXcJ. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Adding Two numbers using bitwise operators only
Refer half adder :) *sum = a ^ b; carry = a & b; while (carry != 0) { carry <<= 1; a = sum; b = carry; sum = a ^ b; carry = a & b; }* On Sat, Aug 20, 2011 at 9:32 PM, Sanjay Rajpal wrote: > Hey frnds, > > I am stuck in a problem of adding two numbers using bitwise operators only. > > An explanation is required. > > > Sanju > :) > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Re: Search an array of unknown length
thanks for pointing it out On Sat, Aug 20, 2011 at 12:16 AM, Dave wrote: > @Sagar: So far so good, but you are not guaranteed to get an > exception. Example, int a[987] is followed in memory by char > b[1000], which is a dictionary. You won't detect an exception > until you get to at least a[262144] (2 to the 18th). But you will pick > up plenty of garbage which may throw off your binary search. > > Dave > > On Aug 19, 1:26 pm, sagar pareek wrote: > > Well > > sorry but i forget to mention exceptions in the solution. > > Here is the complete solution :- > > > > The key idea here is to simultaneously do a binary search > > for the end of the array as well as the key. We try to look for A[2k ] in > > the > > k-th step and catch exceptions for successive values of k till either we > hit > > an exception or we hit a number greater than or equal to b. Then we do > > a binary search for b between indices 2k - 1 and 2k . The runtime of the > > search algorithm is 0 (l og 叫. > > > > > > > > > > > > On Fri, Aug 19, 2011 at 11:53 PM, Dave wrote: > > > @Everyone: The problem says that the array is of UNKNOWN length, but > > > all of the solutions presented assume that the array is of INFINITE > > > length. Suppose, e.g., that the length is 987, but you don't know > > > that. Then it will be meaningless to probe at 1, 10, 100, 1000, etc, > > > or 1, 2, 4, ..., 512, 1024 because any probe beyond 987 is outside the > > > array. An address violation may occur, or arbitrary data, unrelated to > > > the data in the array may be used. I think the problem as stated is > > > unsolvable. > > > > > Dave > > > > > On Aug 19, 12:48 pm, sagar pareek wrote: > > > > HI, > > > > > > I have encountered a problem :- > > > > > > You have an array of *UNKNOWN *length . And you have to find an > element > > > > in O(log(n)) time without using any extra space. > > > > > > -- > > > > **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. > > > > -- > > **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. > > -- **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] Re: Search an array of unknown length
Well sorry but i forget to mention exceptions in the solution. Here is the complete solution :- The key idea here is to simultaneously do a binary search for the end of the array as well as the key. We try to look for A[2k ] in the k-th step and catch exceptions for successive values of k till either we hit an exception or we hit a number greater than or equal to b. Then we do a binary search for b between indices 2k - 1 and 2k . The runtime of the search algorithm is 0 (l og 叫. On Fri, Aug 19, 2011 at 11:53 PM, Dave wrote: > @Everyone: The problem says that the array is of UNKNOWN length, but > all of the solutions presented assume that the array is of INFINITE > length. Suppose, e.g., that the length is 987, but you don't know > that. Then it will be meaningless to probe at 1, 10, 100, 1000, etc, > or 1, 2, 4, ..., 512, 1024 because any probe beyond 987 is outside the > array. An address violation may occur, or arbitrary data, unrelated to > the data in the array may be used. I think the problem as stated is > unsolvable. > > Dave > > On Aug 19, 12:48 pm, sagar pareek wrote: > > HI, > > > > I have encountered a problem :- > > > > You have an array of *UNKNOWN *length . And you have to find an element > > in O(log(n)) time without using any extra space. > > > > -- > > **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. > > -- **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] Re: probability! tough one to crack!
GOOD one dave and thanks divye for a wonderful explanation On Fri, Aug 19, 2011 at 11:44 PM, DK wrote: > For those of you who want an explanation of Dave's answer, please refer to > the diagram below. > > | 0.5 in |-| 0.5 in | > xxx - > xxx 0.5 in > xxx - > xx...xx | > xx...xx | > xx...xx | > xx...xx | > xxx - > xxx 0.5 in > xxx - > > Since the radius of the coin is 0.5 in, if the center of the coin falls in > the x area, it will cross a grid line. > So, probability of the coin not crossing the grid lines is area of dots / > area of square = (1 inch square / 4 inch square) = 1/4 > > -- > DK > > http://www.divye.in > http://twitter.com/divyekapoor > http://gplus.to/divyekapoor > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/algogeeks/-/osMGCscKC70J. > > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Search an array of unknown length
:) On Fri, Aug 19, 2011 at 11:43 PM, Sanjay Rajpal wrote: > Thats wat I said, it depends. Searching in the interval will compensate > reaching the index earlier. > So both are almost equivalent. > > Sanju > :) > > > > On Fri, Aug 19, 2011 at 11:12 AM, sagar pareek wrote: > >> Well i think it depends... >> because range of x and 10x is more than i and 2i >> no doubt multiple of 10 will give us early index but then to find number >> in b/w indexes is more than of 2^i >> >> >> On Fri, Aug 19, 2011 at 11:38 PM, Sanjay Rajpal wrote: >> >>> Multiplication by 10 or 2^i , it depends. >>> >>> Multiplication by 10 will be faster, I think. >>> >>> Sanju >>> :) >>> >>> >>> >>> On Fri, Aug 19, 2011 at 11:05 AM, sagar pareek wrote: >>> >>>> hmmm ok >>>> i found a solution in which index searching is done by 2^i >>>> which is more optimal >>>> multiplication by 10 or 2 power i ??i=0,1,2,3. >>>> >>>> On Fri, Aug 19, 2011 at 11:30 PM, Sanjay Rajpal wrote: >>>> >>>>> See at each step you are multiplying the index to be compared by >>>>> 10(say), this increase is exponential. >>>>> Therefore the search is exponential and complexity is log n. Base >>>>> depends on the factor by which you are multiplying for the next index to >>>>> be >>>>> compared. >>>>> >>>>> Sanju >>>>> :) >>>>> >>>>> >>>>> >>>>> On Fri, Aug 19, 2011 at 10:57 AM, sagar pareek >>>>> wrote: >>>>> >>>>>> @Sanjay >>>>>> yeah its the very basic idea that comes in mind >>>>>> but is your index searching log n ? >>>>>> i think no !! >>>>>> if yes then tell me how? >>>>>> >>>>>> >>>>>> On Fri, Aug 19, 2011 at 11:24 PM, Sanjay Rajpal wrote: >>>>>> >>>>>>> I forgot to mention one thing, at each comparison, store the index at >>>>>>> which we searched previously. >>>>>>> >>>>>>> Sanju >>>>>>> :) >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Fri, Aug 19, 2011 at 10:53 AM, Sanjay Rajpal wrote: >>>>>>> >>>>>>>> You can do it very easily. >>>>>>>> >>>>>>>> I assume array is sorted and contains integers. >>>>>>>> >>>>>>>> Say start at position 1, if value at that index is equal to the >>>>>>>> value to be found, return index. >>>>>>>> else if value at that index is greater than the value to be found, >>>>>>>> we got an interval to search in. >>>>>>>> else(value at that index is smaller than the value to be found) >>>>>>>> search at location 10,then 100, then 1000 till you find an >>>>>>>> interval. >>>>>>>> >>>>>>>> Once you find an interval, perform Binary Search on this and get >>>>>>>> element in O(log n). >>>>>>>> >>>>>>>> Got it ? >>>>>>>> >>>>>>>> Sanju >>>>>>>> :) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Fri, Aug 19, 2011 at 10:48 AM, sagar pareek < >>>>>>>> sagarpar...@gmail.com> wrote: >>>>>>>> >>>>>>>>> HI, >>>>>>>>> >>>>>>>>> I have encountered a problem :- >>>>>>>>> >>>>>>>>> You have an array of *UNKNOWN *length . And you have to find an >>>>>>>>> element in O(log(n)) time without using any extra space. >>>>>>>>> >>>>>>>>> -- >>>>>>>>> **Regards >>>>>>>>> SAGAR PAREEK >>>>>>>>> COMPUTER SCIENCE AND ENGINEERING >>>>>>>>> NIT ALLAHABAD >>>>>>>>> >>>>>>>>> -- >>>>>>>>> You received this message because you
Re: [algogeeks] Search an array of unknown length
Well i think it depends... because range of x and 10x is more than i and 2i no doubt multiple of 10 will give us early index but then to find number in b/w indexes is more than of 2^i On Fri, Aug 19, 2011 at 11:38 PM, Sanjay Rajpal wrote: > Multiplication by 10 or 2^i , it depends. > > Multiplication by 10 will be faster, I think. > > Sanju > :) > > > > On Fri, Aug 19, 2011 at 11:05 AM, sagar pareek wrote: > >> hmmm ok >> i found a solution in which index searching is done by 2^i >> which is more optimal >> multiplication by 10 or 2 power i ??i=0,1,2,3. >> >> On Fri, Aug 19, 2011 at 11:30 PM, Sanjay Rajpal wrote: >> >>> See at each step you are multiplying the index to be compared by 10(say), >>> this increase is exponential. >>> Therefore the search is exponential and complexity is log n. Base depends >>> on the factor by which you are multiplying for the next index to be >>> compared. >>> >>> Sanju >>> :) >>> >>> >>> >>> On Fri, Aug 19, 2011 at 10:57 AM, sagar pareek wrote: >>> >>>> @Sanjay >>>> yeah its the very basic idea that comes in mind >>>> but is your index searching log n ? >>>> i think no !! >>>> if yes then tell me how? >>>> >>>> >>>> On Fri, Aug 19, 2011 at 11:24 PM, Sanjay Rajpal wrote: >>>> >>>>> I forgot to mention one thing, at each comparison, store the index at >>>>> which we searched previously. >>>>> >>>>> Sanju >>>>> :) >>>>> >>>>> >>>>> >>>>> On Fri, Aug 19, 2011 at 10:53 AM, Sanjay Rajpal wrote: >>>>> >>>>>> You can do it very easily. >>>>>> >>>>>> I assume array is sorted and contains integers. >>>>>> >>>>>> Say start at position 1, if value at that index is equal to the value >>>>>> to be found, return index. >>>>>> else if value at that index is greater than the value to be found, we >>>>>> got an interval to search in. >>>>>> else(value at that index is smaller than the value to be found) >>>>>> search at location 10,then 100, then 1000 till you find an >>>>>> interval. >>>>>> >>>>>> Once you find an interval, perform Binary Search on this and get >>>>>> element in O(log n). >>>>>> >>>>>> Got it ? >>>>>> >>>>>> Sanju >>>>>> :) >>>>>> >>>>>> >>>>>> >>>>>> On Fri, Aug 19, 2011 at 10:48 AM, sagar pareek >>>>> > wrote: >>>>>> >>>>>>> HI, >>>>>>> >>>>>>> I have encountered a problem :- >>>>>>> >>>>>>> You have an array of *UNKNOWN *length . And you have to find an >>>>>>> element in O(log(n)) time without using any extra space. >>>>>>> >>>>>>> -- >>>>>>> **Regards >>>>>>> SAGAR PAREEK >>>>>>> COMPUTER SCIENCE AND ENGINEERING >>>>>>> NIT ALLAHABAD >>>>>>> >>>>>>> -- >>>>>>> You received this message because you are subscribed to the Google >>>>>>> Groups "Algorithm Geeks" group. >>>>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>>>> To unsubscribe from this group, send email to >>>>>>> algogeeks+unsubscr...@googlegroups.com. >>>>>>> For more options, visit this group at >>>>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>>>> >>>>>> >>>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Algorithm Geeks" group. >>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>> To unsubscribe from this group, send email to >>>>> algogeeks+unsubscr...@googlegroups.com. >>>>> For more options, visit this group at >>>>> http://groups.google.com/group/algogeeks?hl=en. >>>>> >>>> >>>> >>>> >>>> -- >
Re: [algogeeks] Search an array of unknown length
yeah now if u know then pls tell which is more optimal? On Fri, Aug 19, 2011 at 11:36 PM, Sanjay Rajpal wrote: > but the logic is same na ? > > Sanju > :) > > > > On Fri, Aug 19, 2011 at 11:05 AM, sagar pareek wrote: > >> hmmm ok >> i found a solution in which index searching is done by 2^i >> which is more optimal >> multiplication by 10 or 2 power i ??i=0,1,2,3. >> >> On Fri, Aug 19, 2011 at 11:30 PM, Sanjay Rajpal wrote: >> >>> See at each step you are multiplying the index to be compared by 10(say), >>> this increase is exponential. >>> Therefore the search is exponential and complexity is log n. Base depends >>> on the factor by which you are multiplying for the next index to be >>> compared. >>> >>> Sanju >>> :) >>> >>> >>> >>> On Fri, Aug 19, 2011 at 10:57 AM, sagar pareek wrote: >>> >>>> @Sanjay >>>> yeah its the very basic idea that comes in mind >>>> but is your index searching log n ? >>>> i think no !! >>>> if yes then tell me how? >>>> >>>> >>>> On Fri, Aug 19, 2011 at 11:24 PM, Sanjay Rajpal wrote: >>>> >>>>> I forgot to mention one thing, at each comparison, store the index at >>>>> which we searched previously. >>>>> >>>>> Sanju >>>>> :) >>>>> >>>>> >>>>> >>>>> On Fri, Aug 19, 2011 at 10:53 AM, Sanjay Rajpal wrote: >>>>> >>>>>> You can do it very easily. >>>>>> >>>>>> I assume array is sorted and contains integers. >>>>>> >>>>>> Say start at position 1, if value at that index is equal to the value >>>>>> to be found, return index. >>>>>> else if value at that index is greater than the value to be found, we >>>>>> got an interval to search in. >>>>>> else(value at that index is smaller than the value to be found) >>>>>> search at location 10,then 100, then 1000 till you find an >>>>>> interval. >>>>>> >>>>>> Once you find an interval, perform Binary Search on this and get >>>>>> element in O(log n). >>>>>> >>>>>> Got it ? >>>>>> >>>>>> Sanju >>>>>> :) >>>>>> >>>>>> >>>>>> >>>>>> On Fri, Aug 19, 2011 at 10:48 AM, sagar pareek >>>>> > wrote: >>>>>> >>>>>>> HI, >>>>>>> >>>>>>> I have encountered a problem :- >>>>>>> >>>>>>> You have an array of *UNKNOWN *length . And you have to find an >>>>>>> element in O(log(n)) time without using any extra space. >>>>>>> >>>>>>> -- >>>>>>> **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
Re: [algogeeks] Search an array of unknown length
hmmm ok i found a solution in which index searching is done by 2^i which is more optimal multiplication by 10 or 2 power i ??i=0,1,2,3. On Fri, Aug 19, 2011 at 11:30 PM, Sanjay Rajpal wrote: > See at each step you are multiplying the index to be compared by 10(say), > this increase is exponential. > Therefore the search is exponential and complexity is log n. Base depends > on the factor by which you are multiplying for the next index to be > compared. > > Sanju > :) > > > > On Fri, Aug 19, 2011 at 10:57 AM, sagar pareek wrote: > >> @Sanjay >> yeah its the very basic idea that comes in mind >> but is your index searching log n ? >> i think no !! >> if yes then tell me how? >> >> >> On Fri, Aug 19, 2011 at 11:24 PM, Sanjay Rajpal wrote: >> >>> I forgot to mention one thing, at each comparison, store the index at >>> which we searched previously. >>> >>> Sanju >>> :) >>> >>> >>> >>> On Fri, Aug 19, 2011 at 10:53 AM, Sanjay Rajpal wrote: >>> >>>> You can do it very easily. >>>> >>>> I assume array is sorted and contains integers. >>>> >>>> Say start at position 1, if value at that index is equal to the value to >>>> be found, return index. >>>> else if value at that index is greater than the value to be found, we >>>> got an interval to search in. >>>> else(value at that index is smaller than the value to be found) >>>> search at location 10,then 100, then 1000 till you find an interval. >>>> >>>> Once you find an interval, perform Binary Search on this and get element >>>> in O(log n). >>>> >>>> Got it ? >>>> >>>> Sanju >>>> :) >>>> >>>> >>>> >>>> On Fri, Aug 19, 2011 at 10:48 AM, sagar pareek >>>> wrote: >>>> >>>>> HI, >>>>> >>>>> I have encountered a problem :- >>>>> >>>>> You have an array of *UNKNOWN *length . And you have to find an >>>>> element in O(log(n)) time without using any extra space. >>>>> >>>>> -- >>>>> **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.
Re: [algogeeks] Search an array of unknown length
@Sanjay yeah its the very basic idea that comes in mind but is your index searching log n ? i think no !! if yes then tell me how? On Fri, Aug 19, 2011 at 11:24 PM, Sanjay Rajpal wrote: > I forgot to mention one thing, at each comparison, store the index at which > we searched previously. > > Sanju > :) > > > > On Fri, Aug 19, 2011 at 10:53 AM, Sanjay Rajpal wrote: > >> You can do it very easily. >> >> I assume array is sorted and contains integers. >> >> Say start at position 1, if value at that index is equal to the value to >> be found, return index. >> else if value at that index is greater than the value to be found, we got >> an interval to search in. >> else(value at that index is smaller than the value to be found) >> search at location 10,then 100, then 1000 till you find an interval. >> >> Once you find an interval, perform Binary Search on this and get element >> in O(log n). >> >> Got it ? >> >> Sanju >> :) >> >> >> >> On Fri, Aug 19, 2011 at 10:48 AM, sagar pareek wrote: >> >>> HI, >>> >>> I have encountered a problem :- >>> >>> You have an array of *UNKNOWN *length . And you have to find an >>> element in O(log(n)) time without using any extra space. >>> >>> -- >>> **Regards >>> SAGAR PAREEK >>> COMPUTER SCIENCE AND ENGINEERING >>> NIT ALLAHABAD >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from this group, send email to >>> algogeeks+unsubscr...@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/algogeeks?hl=en. >>> >> >> > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- **Regards SAGAR PAREEK COMPUTER SCIENCE AND ENGINEERING NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Search an array of unknown length
HI, I have encountered a problem :- You have an array of *UNKNOWN *length . And you have to find an element in O(log(n)) time without using any extra space. -- **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]
well we can take anything as he stated in any order On Fri, Aug 19, 2011 at 9:49 PM, Abhishek Yadav wrote: > Hey try queue instead of stack > > > On Fri, Aug 19, 2011 at 9:47 PM, sagar pareek wrote: > >> traverse the list and print only odd numbers and if even number encounter >> store it in a stack and later on print it >> >> On Fri, Aug 19, 2011 at 9:29 PM, sukran dhawan wrote: >> >>> There is a Circular Singly Linked List with n nodes having sorted values >>> from 1 to n. Need to print the odd and even numbers in groups in a single >>> traversal. >>> Eg. Input: 1->2->3->4->5->6->1 Output: {Any combination of Odd Nos} {Any >>> combination of Even Nos} Eg. 1 3 5 6 4 2. write a program for same? >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Algorithm Geeks" group. >>> To post to this group, send email to algogeeks@googlegroups.com. >>> To unsubscribe from 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.
Re: [algogeeks]
traverse the list and print only odd numbers and if even number encounter store it in a stack and later on print it On Fri, Aug 19, 2011 at 9:29 PM, sukran dhawan wrote: > There is a Circular Singly Linked List with n nodes having sorted values > from 1 to n. Need to print the odd and even numbers in groups in a single > traversal. > Eg. Input: 1->2->3->4->5->6->1 Output: {Any combination of Odd Nos} {Any > combination of Even Nos} Eg. 1 3 5 6 4 2. write a program for same? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Answer these ques !!
ok i got it!! oracle apps !! :D :D actually i got it from ur last post of bianry tree question :) :) On Fri, Aug 19, 2011 at 9:38 PM, sagar pareek wrote: > ok nair so tell me from where u found these questions? > > > On Fri, Aug 19, 2011 at 9:19 PM, jestincobol nair > wrote: > >> A binary search tree is defined as follows. >> >> Each node has a key, a value, a (possibly null) left child, and a >> (possibly null) right child. >> An ordering is defined on the keys to be stored in the tree. >> For a given node nd, the keys of all the nodes in its left subtree are >> “before” nd’s key, and the keys of all the nodes in its right subtree are >> “after” nd’s key. >> The depth of the root node is defined to be 0; the depth of any other >> node is 1 more than the depth of its parent. >> >> How would the next() function of a binary search tree’s iterator be >> defined, assuming no changes are made to the tree while the iterator is >> active? >> >> Note: next() should return the value at each node in order of the >> corresponding keys; also, assume for each answer that the iterator has been >> appropriately initialized before the first call to next(). >> >> 1. using a queue: >> >>nd = q.remove() >>q.add(nd.leftChild) >>a.qdd(nd.rightChild) >>return nd.value >> >> 2. using a stack: >> >>nd = stk.remove() >>stk.add(nd.leftChild) >>stk.add(nd.rightChild) >>return nd.value >> >> 3. using a stack: >> >>nd = stk.remove() >>nxt = nd.getRight() >>while (null != nxt) { stk.push(nxt); nxt = nxt.getLeft(); } >>return nd.value >> >> >> >> 1 is correct >> >> >> 2 is correct >> >> >> 3 is correct >> >> >> None of these >> >> >> plz say ur answers for this ?? >> >> >> On Fri, Aug 19, 2011 at 9:18 PM, jestincobol nair >> wrote: >> >>> @ sagar:no dude !! dese are of not of citrix :) >>> >>> >>> On Fri, Aug 19, 2011 at 9:14 PM, sagar pareek wrote: >>> >>>> @nair >>>> Are these questions of CITRIX? >>>> >>>> coz all these questions i already faced somewhere >>>> >>>> >>>> On Fri, Aug 19, 2011 at 9:12 PM, priya ramesh < >>>> love.for.programm...@gmail.com> wrote: >>>> >>>>> 5th is option 1 sorry >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Algorithm Geeks" group. >>>>> To post to this group, send email to algogeeks@googlegroups.com. >>>>> To unsubscribe from 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 > > -- **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] Answer these ques !!
ok nair so tell me from where u found these questions? On Fri, Aug 19, 2011 at 9:19 PM, jestincobol nair wrote: > A binary search tree is defined as follows. > > Each node has a key, a value, a (possibly null) left child, and a > (possibly null) right child. > An ordering is defined on the keys to be stored in the tree. > For a given node nd, the keys of all the nodes in its left subtree are > “before” nd’s key, and the keys of all the nodes in its right subtree are > “after” nd’s key. > The depth of the root node is defined to be 0; the depth of any other > node is 1 more than the depth of its parent. > > How would the next() function of a binary search tree’s iterator be > defined, assuming no changes are made to the tree while the iterator is > active? > > Note: next() should return the value at each node in order of the > corresponding keys; also, assume for each answer that the iterator has been > appropriately initialized before the first call to next(). > > 1. using a queue: > >nd = q.remove() >q.add(nd.leftChild) >a.qdd(nd.rightChild) >return nd.value > > 2. using a stack: > >nd = stk.remove() >stk.add(nd.leftChild) >stk.add(nd.rightChild) >return nd.value > > 3. using a stack: > >nd = stk.remove() >nxt = nd.getRight() >while (null != nxt) { stk.push(nxt); nxt = nxt.getLeft(); } >return nd.value > > > > 1 is correct > > > 2 is correct > > > 3 is correct > > > None of these > > > plz say ur answers for this ?? > > > On Fri, Aug 19, 2011 at 9:18 PM, jestincobol nair > wrote: > >> @ sagar:no dude !! dese are of not of citrix :) >> >> >> On Fri, Aug 19, 2011 at 9:14 PM, sagar pareek wrote: >> >>> @nair >>> Are these questions of CITRIX? >>> >>> coz all these questions i already faced somewhere >>> >>> >>> On Fri, Aug 19, 2011 at 9:12 PM, priya ramesh < >>> love.for.programm...@gmail.com> wrote: >>> >>>> 5th is option 1 sorry >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algogeeks@googlegroups.com. >>>> To unsubscribe from 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.
Re: [algogeeks] Directi
search the archives ... direct i's questions already discussed many times On Fri, Aug 19, 2011 at 9:33 PM, Agyat wrote: > Hi, friends > tom i m having directi written test followed by coding(ol) and written > test is eliminative and i need ur help.What does directi ask in > written and what type ques from which subject and what level of quest > both in written and ol coding round > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Answer these ques !!
@nair Are these questions of CITRIX? coz all these questions i already faced somewhere On Fri, Aug 19, 2011 at 9:12 PM, priya ramesh < love.for.programm...@gmail.com> wrote: > 5th is option 1 sorry! > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] query.. amazon question
Can be done in O(n) time but it will need O(n) space too take another array of same length then its code will be for( i=0,j=0,k=n/2+1 ;i<=n/2&&karr[k]) new[j++]=arr[k++]; else new[j++]=arr[i++]; } if(k wrote: > Sort an array of n positive integers containing n/2 sorted integers in > first and second-half? > in O(n) time complexity .. > and space complexity should be constant > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from 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] Amazon Question
Common yaar its very simple it is good for u to go in deep hence google it or refer a good data structure book On Thu, Aug 18, 2011 at 5:36 PM, Ankur Garg wrote: > Can u provide a bit detail bro !! > > > On Thu, Aug 18, 2011 at 8:04 AM, sagar pareek wrote: > >> Hashing >> :) >> >> On Thu, Aug 18, 2011 at 5:30 PM, Ankur Garg wrote: >> >>> Define a data structure , using extra memory/space , such that : >>> >>> Insert(int a) >>> Delete(int a) >>> isPresent(int a) >>> get(int a) >>> >>> All above operations on the defined data structure take O(1) , i.e. >>> constant time. >>> >>> >>> Any suggestions /solutions for this problem >>> >>> >>> Regards >>> >>> 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. >>> >> >> >> >> -- >> **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.