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
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...@googlegroups.com. -- Rohit Jangid http://rohitjangid.com Graduate Deptt. of Computer Engineering NSIT

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

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 sreekanth.i...@gmail.com wrote: There n stages of a game. At each stage i you will come across a devil. Each devil has

Re: [algogeeks] Re: Amazon Interview Questions

2013-03-12 Thread rohit jangid
. To unsubscribe from this group and stop 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

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

2013-03-04 Thread rohit jangid
Sandeep s.shubhamsand...@gmail.comwrote: 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 rohit.nsi...@gmail.comwrote: output for me for the previous snippet localhost:slingshot rohitjangid$ ./a.out 1799476872 1799474584

Re: [algogeeks] Re: Algo Question

2013-03-03 Thread rohit jangid
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...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Rohit Jangid Graduate Deptt. of Computer

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

2013-03-03 Thread rohit jangid
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 you are subscribed to the Google Groups Algorithm Geeks group

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

2013-03-03 Thread rohit jangid
On Mon, Mar 4, 2013 at 7:33 AM, rohit jangid rohit.nsi...@gmail.com wrote: yeah true . one interesting thing I noticed is that if you run this code #includestdio.h int main() { int i = 0; do { printf (%d\n,(float)1); }while(i++ 1); return 0; } one would expect same

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 mailtoroh...@gmail.com wrote: int main() { int a=256; char *p=a; *++p=2; printf(%d,a);

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 sushaant...@gmail.com wrote:

Re: [algogeeks] GSOC

2011-08-20 Thread rohit jangid
. 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 subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Re: Jumping Puzzle

2011-08-13 Thread rohit jangid
@googlegroups.com. To unsubscribe from 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 Computer Engineering NSIT, Delhi University, India

Re: [algogeeks] Re: Jumping Puzzle

2011-08-13 Thread rohit jangid
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 Computer Engineering NSIT, Delhi University, India -- You received this message because you are subscribed

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 jangid rohit.nsi

Re: [algogeeks]

2011-08-11 Thread rohit jangid
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 subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks

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 love.for.programm...@gmail.com wrote: -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] c question!

2011-08-09 Thread rohit jangid
will nodeptr stand for? On Tue, Aug 9, 2011 at 8:09 PM, rohit jangid rohit.nsi...@gmail.com 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: -- You received this message because you

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 love.for.programm...@gmail.com wrote: #includestdio.htypedef struct {char * a; }*nodeptr; main(){nodeptr

Re: [algogeeks] Javascript

2011-08-08 Thread rohit jangid
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 subscribed to the Google Groups Algorithm Geeks group. To post

Re: [algogeeks] Javascript

2011-08-08 Thread rohit jangid
...@gmail.com 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 rohit.nsi...@gmail.com wrote: javaScript's array are just