Re: [algogeeks] How will you implement a stack using a priority queue. Push and pop should be in O(1)

2013-05-25 Thread rohit jangid
T if any good approach some one is having other than this ? > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to algogeeks+unsubscr.

Re: [algogeeks] Math problem

2013-05-15 Thread rohit jangid
after few attempts I think you must be getting stuck where you need a^3 + b^3 + c^3 value in terms of abc, C1, and C2 which is possible using this identity-- (a+b+c)³=(a³+b³+c³)+3[(a+b+c)(ab+ac+bc)-abc] refer this link for the proof http://math.stackexchange.com/questions/288965/show-that-abc-a-b

Re: [algogeeks] clearing n-stages of a game.

2013-05-04 Thread rohit jangid
a very standard dp problem . try to formulate recurrence relation . it has been mentioned a couple of times on stackoverflow as well . On May 5, 2013 8:28 AM, "sreekanth guru" wrote: > There n stages of a game. At each stage i you will come across a devil. > Each devil has its own energy E(i) and

Re: [algogeeks] Re: Amazon Interview Questions

2013-03-12 Thread rohit jangid
then traverse till m elements and repeat.* >>>> >>>> *Write production quality code.* >>>> >>>> * >>>> * >>>> >>>> *g. An array of elements have been given. Find for each element, first >>>> max element

Re: [algogeeks] help with o/p why 0 comes???

2013-03-04 Thread rohit jangid
ubham Sandeep wrote: > on my system every time o/p is 0 > using ubuntu 10.04 ,gcc compiler > > > On Mon, Mar 4, 2013 at 7:34 AM, rohit jangid wrote: > >> output for me for the previous snippet >> >> localhost:slingshot rohitjangid$ ./a.out >> 1799476872 &

Re: [algogeeks] help with o/p why 0 comes???

2013-03-03 Thread rohit jangid
Mon, Mar 4, 2013 at 7:33 AM, rohit jangid wrote: > yeah true . one interesting thing I noticed is that if you run this code > > #include > int main() > { > int i = 0; > do { > printf ("%d\n",(float)1); > }while(i++ < 1); > return

Re: [algogeeks] help with o/p why 0 comes???

2013-03-03 Thread rohit jangid
receiving emails from it, send an > email to algogeeks+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Rohit Jangid Graduate Deptt. of Computer Engineering NSIT, Delhi University, India -- You received this message because y

Re: [algogeeks] Re: Algo Question

2013-03-03 Thread rohit jangid
gt;B-Tech. Comp. Science and Engg. > >IIT ROORKEE > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to alg

Re: [algogeeks] plz help

2011-09-22 Thread rohit jangid
got 45 on linux than tried with fflush(stdout) and got 9 which is correct . so I guess that both child and parent process getting the same buffer and thus resulting in more number of hello correct answer is 9 as already mentioned On Sep 21, 2011 7:57 PM, "sush57" wrote: > main() > { > int tmp; >

Re: [algogeeks]

2011-09-22 Thread rohit jangid
isn't that simply because if little indian endian way of storing bytes in memory initial -- 0001 0.. finally-- 0010 0.. On Sep 22, 2011 5:38 PM, "Rohit Upadhyaya" wrote: > > int main() > { > int a=256; > char *p=&a; > *++p=2; > printf("%d",a); > return(0); > }

Re: [algogeeks] GSOC

2011-08-20 Thread rohit jangid
gogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Rohit Jangid Under Graduate Student, Deptt. of Computer Engineering NSIT, Delhi University, India -- You received this message because you are subscrib

Re: [algogeeks] Re: Jumping Puzzle

2011-08-13 Thread rohit jangid
ok check this, https://ideone.com/hZboG there may be bugs in coding, but I'm quite sure that algo is correct need to check more cases though but working on all the cases discussed here is there any proof that greedy won't work in this case? On Sat, Aug 13, 2011 at 11:03 PM, rohit jan

Re: [algogeeks] Re: Jumping Puzzle

2011-08-13 Thread rohit jangid
found some bugs , will repost it On Sat, Aug 13, 2011 at 10:55 PM, rohit jangid wrote: > I can only say that above code is wrong, check this code of mine, I > have tested more cases and all are working, > https://ideone.com/pEBs8 > see if you can find any bug in this one . > &

Re: [algogeeks] Re: Jumping Puzzle

2011-08-13 Thread rohit jangid
end email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Rohit Jangid Under Graduate Student, Deptt. of Com

Re: [algogeeks] Re: Jumping Puzzle

2011-08-13 Thread rohit jangid
e Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/algogeeks/-/37L_lAEKGVkJ. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...

Re: [algogeeks]

2011-08-11 Thread rohit jangid
be from 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" gro

Re: [algogeeks] c question!

2011-08-09 Thread rohit jangid
when you declared " h" it contains garbage address . h->a is meaningless . read pointers chapter from K nd R for full details about pointers in C . On Aug 9, 2011 9:11 PM, "programming love" wrote: > #includetypedef struct {char * a; > }*nodeptr; > main(){nodeptr h;h->a="programming";printf("hi %

Re: [algogeeks] c question!

2011-08-09 Thread rohit jangid
for? > > On Tue, Aug 9, 2011 at 8:09 PM, rohit jangid wrote: > >> it will give error in line 3 because nodeptr is undefined till that point.. >> >> On Aug 9, 2011 8:03 PM, "programming love" < love.for.programm...@gmail.com> >> wrote: >> -

Re: [algogeeks] c question!

2011-08-09 Thread rohit jangid
it will give error in line 3 because nodeptr is undefined till that point.. On Aug 9, 2011 8:03 PM, "programming love" wrote: -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. T

Re: [algogeeks] Javascript

2011-08-08 Thread rohit jangid
wrote: > Well actually there are about 1000 values to be stored, but the value itself > is small(url of a website..).. i think it should not be a major bottleneck.. > > Thanks, > Priyanshu > > On Mon, Aug 8, 2011 at 2:39 PM, rohit jangid wrote: > >> javaScript&#x

Re: [algogeeks] Javascript

2011-08-08 Thread rohit jangid
eks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Rohit Jangid Under Graduate Student, Deptt. of Computer Engineering NSIT, Delhi University, India -- You received this message because you are subscribe