[algogeeks] c output doubt
int main() { int a[5]={1,2,3,4,5}; printf(%d,a[4]-a[0]) } why it show 4 not 16? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 doubt
Pointer incrementation and subtraction are done in terms of memory blocks and not addresses of memory. For example, int *p; p++; The pointer here jumps to the next integer location and not the next address in memory. Similarly,pointer subtraction will give the difference in indexes and not the memory addresses. If you try subtracting an integer pointer and a float pointer, it will be an error. On Fri, Aug 12, 2011 at 11:34 AM, rohit rajuljain...@gmail.com wrote: int main() { int a[5]={1,2,3,4,5}; printf(%d,a[4]-a[0]) } why it show 4 not 16? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] c output doubt
i didn't tried it .. but it might be internal conversion only , like whenever we do +1 to the address of int it automatically convert it into +4(i.e int size) On Fri, Aug 12, 2011 at 11:34 AM, rohit rajuljain...@gmail.com wrote: int main() { int a[5]={1,2,3,4,5}; printf(%d,a[4]-a[0]) } why it show 4 not 16? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Varun Jakhoria ...it's only about 0's 1's -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: c output doubt
Thanks a lot On Aug 12, 11:25 am, Avinash Dharan avinashdha...@gmail.com wrote: Pointer incrementation and subtraction are done in terms of memory blocks and not addresses of memory. For example, int *p; p++; The pointer here jumps to the next integer location and not the next address in memory. Similarly,pointer subtraction will give the difference in indexes and not the memory addresses. If you try subtracting an integer pointer and a float pointer, it will be an error. On Fri, Aug 12, 2011 at 11:34 AM, rohit rajuljain...@gmail.com wrote: int main() { int a[5]={1,2,3,4,5}; printf(%d,a[4]-a[0]) } why it show 4 not 16? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] c output doubt
4*(sizeof(int *)) Thank you, Siddharam On Fri, Aug 12, 2011 at 11:56 AM, Varun Jakhoria varunjakho...@gmail.comwrote: i didn't tried it .. but it might be internal conversion only , like whenever we do +1 to the address of int it automatically convert it into +4(i.e int size) On Fri, Aug 12, 2011 at 11:34 AM, rohit rajuljain...@gmail.com wrote: int main() { int a[5]={1,2,3,4,5}; printf(%d,a[4]-a[0]) } why it show 4 not 16? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Varun Jakhoria ...it's only about 0's 1's -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] c output doubt
On Fri, Aug 12, 2011 at 11:55 AM, Avinash Dharan avinashdha...@gmail.comwrote: Pointer incrementation and subtraction are done in terms of memory blocks and not addresses of memory. For example, int *p; p++; The pointer here jumps to the next integer location and not the next address in memory. Similarly,pointer subtraction will give the difference in indexes and not the memory addresses. If you try subtracting an integer pointer and a float pointer, it will be an error. On Fri, Aug 12, 2011 at 11:34 AM, rohit rajuljain...@gmail.com wrote: int main() { int a[5]={1,2,3,4,5}; printf(%d,a[4]-a[0]) } why it show 4 not 16? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] amazon help
thanx...downloaded :) On Fri, Aug 12, 2011 at 10:56 AM, coolfrog$ dixit.coolfrog.div...@gmail.com wrote: @all can some plz suggest the source for where i can fine the dates and news regarding amazon off-campus Placements. On Fri, Aug 12, 2011 at 6:36 AM, Akash Mukherjee akash...@gmail.comwrote: Hi, Can anyone suggest from where I should practice for the online coding round for amazon off-campus placements. I am looking for similar problems not for the environment. Thanx, Akash -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- *Divesh* (¨`·.·´¨) Always `·.¸(¨`·.·´¨ ) Keep (¨`·.·´¨)¸.·´Smiling! `·.¸.·´ Life can give u 100's of reason 2cry,but u can give life 1000's of reasons 2Smile -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] iocl recruitment process
iocl is coming to my college please any dceite please tell what they are asking in their interview process and what profile they are offering to the coe candidate -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] TRee question...
if given node has right subtree then its inorder successor will be left most child of given node's right child. if given node does not have right child the its successor will be its parent On Fri, Aug 12, 2011 at 11:28 AM, Priyanka Goel priyankatheinvinci...@gmail.com wrote: How to find the in-order successor of a given node in a binary search tree where each node has a link to its parent. pl explain logic to solve it.. ( Pl dnt give solution of doing in order traversal and storing it in array.) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **With Regards Deoki Nandan Vishwakarma * * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Design .. how to attack ???
First thing tat should come to your mind s ' requirements ' ask him wat de requirements are. He will expect tat.. On 8/12/11, MAC macatad...@gmail.com wrote: Hi guys , Can anyone help me in understanding what is expected when some some one asks you design a car rental system . Exactly what all is required to be told to the interviewer . -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sent from my mobile device -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] reverse
I understand , impact I find some more trials like these , I mean I really about bit thinking hacks On 8/12/11, Tarun Arya tarun@gmail.com wrote: RAHUL@ d question was to reverse d 2 numbers...it can b done by wat i hav said... if u want 2 extract numbers then a0x0f //this wil giv number in units place... a0xf0 a4//this wil give number in tens place correct me if i m wrong Tarun -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Rahul -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] sourcebits
Hey guys, please help me can anyone post some written and interview question asked by sourcebits by Guna -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] TRee question...
What Deoki answered in valid for non-leaf node. Consider this tree: 3 / \ 4 5 / \ 6 7 According to Deoki's answer, 7's in-order successor is 4, which not correct. the answer should be 3. Here is the proper method (for leaf node only), Following Deoki's answer for non-leaf: - keep a stack in which you keep adding the left child (if there is any) at the node. - in case you don't have a left child, pop the last parent. and push the right child. Repeat above process. - when you hit the node you are searching for and is a leaf node, then just pop the last element from stack. That will the inorder successor. e.g in above tree, in-order successor of 7. from start stack will be |3| - | 4 | push(3-left) = 4 | 3 | - | 6 | push(4-left) = 6 | 4 | | 3 | - no left of 6, and pop 6, and check right. - no right of 6, pop next element, i.e. 4 - push (4-right) | 7 | | 3 | - Found 7 and '7' is a leaf node, thus in-order successor is pop (next element) = 3 Hope that's clear. On 12 August 2011 12:34, Deoki Nandan deok...@gmail.com wrote: if given node has right subtree then its inorder successor will be left most child of given node's right child. if given node does not have right child the its successor will be its parent On Fri, Aug 12, 2011 at 11:28 AM, Priyanka Goel priyankatheinvinci...@gmail.com wrote: How to find the in-order successor of a given node in a binary search tree where each node has a link to its parent. pl explain logic to solve it.. ( Pl dnt give solution of doing in order traversal and storing it in array.) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **With Regards Deoki Nandan Vishwakarma * * -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] reverse
I understand. where I find some more tricks like these , I mean I really. find. bit thinking hacks. difficult to understand. On 8/12/11, Tarun Arya tarun@gmail.com wrote: RAHUL@ d question was to reverse d 2 numbers...it can b done by wat i hav said... if u want 2 extract numbers then a0x0f //this wil giv number in units place... a0xf0 a4//this wil give number in tens place correct me if i m wrong Tarun -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Rahul -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Design .. how to attack ???
thanks guys .. so lets take the question we had design a car rental system .. so the interviewer can say , ok requirement is that you have a pool of cars , people come and book a car for a particular time slot if available . This is the most basic thing . so now what , what shd i do next --mac On Fri, Aug 12, 2011 at 1:11 PM, keyan karthi keyankarthi1...@gmail.comwrote: First thing tat should come to your mind s ' requirements ' ask him wat de requirements are. He will expect tat.. On 8/12/11, MAC macatad...@gmail.com wrote: Hi guys , Can anyone help me in understanding what is expected when some some one asks you design a car rental system . Exactly what all is required to be told to the interviewer . -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sent from my mobile device -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Question
Explanation please On Fri, Aug 12, 2011 at 9:33 AM, Dipankar Patro dip10c...@gmail.com wrote: b. On 11 August 2011 23:20, arvind kumar arvindk...@gmail.com wrote: b. On Thu, Aug 11, 2011 at 11:18 PM, Mani Bharathi manibharat...@gmail.comwrote: int(* fun()) [row][ Col]; What should be the statement the for the above declarations a.fun() points to a two dimensional array b.pointer *fun() points to a two dimensional array c.pointer *fun() points to 1-dimensional array -- 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/-/3xkodl3aLvcJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] how o/p is coming
if it were if(a,b,y,x) then output wud hav been EXAM On Fri, Aug 12, 2011 at 4:14 AM, Prakash D cegprak...@gmail.com wrote: @anuj kumar: try this #includestdio.h #includestring.h int main() { int a=10,b=20; char x=1,y=0; printf(%d\n,a,b,x,y); printf(%d\n,(a,b,x,y)); if(a,b,x,y) { printf(EXAM); } getchar(); } this will print 10 and 0 because if the outer bracket is not there, only the first element is considered it ignores the rest. if there is a bracket it just pushes into the stack left to right and the last element is considered.. within if, there is no outer brackets but it tries to convert to bool and statement will execute like if((bool)(a,b,x,y)) so the if condition fails correct me if i'm wrong On Thu, Aug 11, 2011 at 5:18 PM, sukran dhawan sukrandha...@gmail.comwrote: the output should be blank. because comma is a operator in c which associates from left to right. so each of a ,b,x,y is evaluated and y is the last one to be evaluated and its value(0) is returned as the value of the expression.so the if condition returns false. i dont understand how u got that output ! On Thu, Aug 11, 2011 at 4:29 PM, Prem Krishna Chettri hprem...@gmail.com wrote: Yep, Ideally, if() statement evaluates the last push stack value from the stack and apparently here the last value evaluates to be 0 resulting the failure of the if condition. Please verify the compilation. :) Prem On Thu, Aug 11, 2011 at 4:21 PM, hary rathor harry.rat...@gmail.comwrote: print nothing , your output is wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- Rishi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Question
Ideally Speaking all of the option here seems not matching as this is the function pointer not an ordinary pointer. So the closest match is b but actually its not pointing to any 2 D or 3 D array or somewhat but rather it points to the block of memory starts from the dynamic address of row and onwards which depends upon the function stack on which its been pointing. On Fri, Aug 12, 2011 at 1:42 PM, Sachin Jain sachinjain...@gmail.comwrote: Explanation please On Fri, Aug 12, 2011 at 9:33 AM, Dipankar Patro dip10c...@gmail.comwrote: b. On 11 August 2011 23:20, arvind kumar arvindk...@gmail.com wrote: b. On Thu, Aug 11, 2011 at 11:18 PM, Mani Bharathi manibharat...@gmail.com wrote: int(* fun()) [row][ Col]; What should be the statement the for the above declarations a.fun() points to a two dimensional array b.pointer *fun() points to a two dimensional array c.pointer *fun() points to 1-dimensional array -- 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/-/3xkodl3aLvcJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] how o/p is coming
the thing is Condition if(a,b,x,y) is evaluated by the last variable present in it bcoz Comma Operator return the last variable or constant present in it. give y some other value than 0 you will see the difference -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Fri, Aug 12, 2011 at 1:51 PM, sirshak das rishi.godfat...@gmail.comwrote: if it were if(a,b,y,x) then output wud hav been EXAM On Fri, Aug 12, 2011 at 4:14 AM, Prakash D cegprak...@gmail.com wrote: @anuj kumar: try this #includestdio.h #includestring.h int main() { int a=10,b=20; char x=1,y=0; printf(%d\n,a,b,x,y); printf(%d\n,(a,b,x,y)); if(a,b,x,y) { printf(EXAM); } getchar(); } this will print 10 and 0 because if the outer bracket is not there, only the first element is considered it ignores the rest. if there is a bracket it just pushes into the stack left to right and the last element is considered.. within if, there is no outer brackets but it tries to convert to bool and statement will execute like if((bool)(a,b,x,y)) so the if condition fails correct me if i'm wrong On Thu, Aug 11, 2011 at 5:18 PM, sukran dhawan sukrandha...@gmail.comwrote: the output should be blank. because comma is a operator in c which associates from left to right. so each of a ,b,x,y is evaluated and y is the last one to be evaluated and its value(0) is returned as the value of the expression.so the if condition returns false. i dont understand how u got that output ! On Thu, Aug 11, 2011 at 4:29 PM, Prem Krishna Chettri hprem...@gmail.com wrote: Yep, Ideally, if() statement evaluates the last push stack value from the stack and apparently here the last value evaluates to be 0 resulting the failure of the if condition. Please verify the compilation. :) Prem On Thu, Aug 11, 2011 at 4:21 PM, hary rathor harry.rat...@gmail.comwrote: print nothing , your output is wrong -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- Rishi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] O/P
@dipankar +1 -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Fri, Aug 12, 2011 at 9:31 AM, Dipankar Patro dip10c...@gmail.com wrote: The question is full of errors. Provide the link, if you have copied it from somewhere. On 11 August 2011 23:53, Mani Bharathi manibharat...@gmail.com wrote: What will be the output of the following program #include int main() { int m=10,p; p=incre(incre (incre (++) incre) incre) Printf(%d, *P); return 0; } incre (int m) { m+=2; return(m-2); } how? -- 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/-/58_0-nbLUacJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] logic???????????
to implement a binary search in an array which is sorted but roated by some k places which is nt kwn time complexity O(logn) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] logic???????????
i doubt if it is possible in O(logn). i think you can first 'k' in one traversal and then make the array as it was before in O(n) and then apply binary search.so its basically a O(n) solution... if anyone has better ideas then please share !!. -- Amol Sharma Third Year Student Computer Science and Engineering MNNIT Allahabad On Fri, Aug 12, 2011 at 3:17 PM, jagrati verma jagrativermamn...@gmail.comwrote: to implement a binary search in an array which is sorted but roated by some k places which is nt kwn time complexity O(logn) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Remove spaces
A huge paragraph has irregular spaces between the words, how to effectively we can make everything to single space. Example : My name is xyz Should to converted to : My name is xyz -- Thanks and regards, Raghavan.K.L http://in.linkedin.com/in/raghavankl -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 spaces
easy can be done in O(n) time and in O(1) On Fri, Aug 12, 2011 at 3:47 PM, Raghavan its...@gmail.com wrote: A huge paragraph has irregular spaces between the words, how to effectively we can make everything to single space. Example : My name is xyz Should to converted to : My name is xyz -- Thanks and regards, Raghavan.K.L http://in.linkedin.com/in/raghavankl -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 spaces
and in O(1) space On Fri, Aug 12, 2011 at 3:53 PM, sagar pareek sagarpar...@gmail.com wrote: easy can be done in O(n) time and in O(1) On Fri, Aug 12, 2011 at 3:47 PM, Raghavan its...@gmail.com wrote: A huge paragraph has irregular spaces between the words, how to effectively we can make everything to single space. Example : My name is xyz Should to converted to : My name is xyz -- Thanks and regards, Raghavan.K.L http://in.linkedin.com/in/raghavankl -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Remove spaces
void delExtraSpaces (char *Str) { int Pntr = 0; int Dest = 0; int flag=0; while (Str [Pntr]) { if (Str [Pntr] != ' ') { Str [Dest++] = Str [Pntr]; flag=0; } else if(Str[Ptr]==' ' flag==1) Str [Dest++] = Str [Pntr]; else flag=1; Pntr++; } Str [Pntr] = '/0'; } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: amazon help
@Akshmkj , A Blog For Geeks , Fresher Might Stuck !!! http://shashank7s.blogspot.com - Cracking The Code You Might Enjoy Regards 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/-/RNWXT-3cNusJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 help
@ Shashank :- Amazing one.. thx for Share.. :) Prem On Fri, Aug 12, 2011 at 4:15 PM, WgpShashank shashank7andr...@gmail.comwrote: @Akshmkj , A Blog For Geeks , Fresher Might Stuck !!! http://shashank7s.blogspot.com - Cracking The Code You Might Enjoy Regards 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/-/RNWXT-3cNusJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: TRee question...
@priya here is algorithm Algorithm: (With Using Parent Pointer ) 1) If right subtree of node is not NULL, then successor lies in right subtree. Do following. Go to right subtree and return the node with minimum key value in right subtree. 2) If right sbtree of node is NULL, then successor is one of the ancestors. Do following. Travel up using the parent pointer until you see a node which is left child of it’s parent. The parent of such a node is the successor If We have already given BST (e.g. need not to build then inorder successor can be found in O(N) N number of nodes in tree) but it uses parent pointer overhead :) Can't we do without parent pointer ? We Can Also Do The .without using parent pointer for detail of both code algorithm you can refer http://shashank7s.blogspot.com/2011/03/wap-to-inorder-successor.html i have given complexity analysis as well !!! Do notify me via mail if anything wrong ? 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/-/UcXoGH22TrcJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: TRee question...
@Dipankar Patro - The figure u have made isn't a BST.Read the problem. His soln. is correct. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 help
sure, thanx :) On Fri, Aug 12, 2011 at 4:15 PM, WgpShashank shashank7andr...@gmail.comwrote: @Akshmkj , A Blog For Geeks , Fresher Might Stuck !!! http://shashank7s.blogspot.com - Cracking The Code You Might Enjoy Regards 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/-/RNWXT-3cNusJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] You have to count the occurances of all words in a document. You are given a method chat * GetNextWord, that returns the next word from the document.
Hi all, i want to unsubscribe from this group.kindly make me out of this group. now i am feeling little iritation from these mails.so please ..do thid needful On 3/5/10, Umer Farooq the.um...@gmail.com wrote: Thanks for lettimg me know that. Although I have used this kinda thingy in solving a lot of problems; but, I never knew that it is called a trie. On Thu, Mar 4, 2010 at 8:08 PM, Chakravarthi Muppalla chakri...@gmail.comwrote: @Umer 'categorize the words into 26 categories depending on the initial character', as far as i know this is the principle of a trie. look up trie for the next word, if exists increment count; other wise start counter and insert into trie; i think this one would work. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@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. -- Thanks and Regards Mukesh Kumar +91-9945194097 mukeshraj8...@gmail.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks]
earlier it has been posted in the group that check the size of pointer variable, if it is 2b then 16 bit 4b then 32 bit 8b then 64 bit -- 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/-/EoFyFYjhHT0J. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Problems on Linked List
Q2). i think for second question it will be enough to just swap the data of current node to next node, and delete the next node. it will be like, //for swap int temp=current-data; current-data=current-next-data; current-next-data=temp; //for delete struct node *temp; temp=current-next; current-next=current-next-next; free(temp); i think it will be enough even in case of last node. correct me if i am wrong. -- 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/-/N1elA8-W-iUJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 help
@Prem, akashmkj, Thanks Geeks, Whenever you read any post , do notify me via mail or comment in post if anything wrong in post, i think this the best way to test algorithm for different test cases making that efficient . * Regards Shashank Mani Computer Science Is Awesome So Why I Write Code 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/-/GcwGtM_RntQJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] an array question
An array of integers is given and you have to find the largest possible integer by concatenating all elements: example: array: 87 36 52 answer: 875236 array: 87 9 52 answer: 98752 -- 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/-/_lJJOlRG_ukJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] an array question
1 Sort the Array 2 Put it to the String Accordingly.. Prem On Fri, Aug 12, 2011 at 6:04 PM, Yasir Imteyaz yasir@gmail.com wrote: An array of integers is given and you have to find the largest possible integer by concatenating all elements: example: array: 87 36 52 answer: 875236 array: 87 9 52 answer: 98752 -- 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/-/_lJJOlRG_ukJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] an array question
Kindly check it with both the examples. It won't work. -- 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/-/VlT1DNH-vPkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] an array question
radix sort the digits wrong way (left most digit first), and then concatenate On Fri, Aug 12, 2011 at 6:12 PM, Yasir yasir@gmail.com wrote: Kindly check it with both the examples. It won't work. -- 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/-/VlT1DNH-vPkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] an array question
Amazing , Kindly Follow me up :- 1 Given Array of Random Value ... say int a[]= {20,365,299,50,67,21}; Apply Any Sorting Algo on it... which Results into somewhat like a={365,299,67,50,21,20,.. blah..}... 2 Well No U hv to put those values to a string variable. Please lemme knw if I need more clarification.. This is simple where is the messy part?? On Fri, Aug 12, 2011 at 6:16 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: radix sort the digits wrong way (left most digit first), and then concatenate On Fri, Aug 12, 2011 at 6:12 PM, Yasir yasir@gmail.com wrote: Kindly check it with both the examples. It won't work. -- 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/-/VlT1DNH-vPkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] logic???????????
Hi Guys Here is the algorithm for doing same in O(logn) Hint : Find the pivot point, divide the array in two sub-arrays and call binary search. Thats It :) Algorithm 1. A Pivot Point is point around which array is rotated so 1st we need to find out its location/index. lets say it pivot. a. to find pivot point we use same idea of binary search check if arr[mid]a[mid+1] if true then return pivot=mid. b else if arr[low]a[mid] search for pivot in left c. else search for pivot in right half of array. Time Complexity O(logn) 2. Once we have found index of pivot point check if desired element is same value at pivot index or not e.g. a. ( if a[pivot]==value we are searching for ) the simply return true or 1 . Now call binary search for one of the two sub-arrays. (ab) *If *element is greater than 0th element then search in left array (ac) *Else* Search in right array * (ad) If *element is found in selected sub-array then return index *Else *return -1. Again Time Complexity O(logn) Hope You Can Make it in Running Code , Do Noify me if You Need More Explanation or if missed Something?? *Regards Shashank Mani Computer Science Is Awesome So Why I Write Code 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/-/QPCzNLNf_sEJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] an array question
see the second example...if a single digit is there...tht will be at the very end of the array...and if it is 9 it must come at first place...there it goes wrong... On Fri, Aug 12, 2011 at 6:23 PM, Prem Krishna Chettri hprem...@gmail.comwrote: Amazing , Kindly Follow me up :- 1 Given Array of Random Value ... say int a[]= {20,365,299,50,67,21}; Apply Any Sorting Algo on it... which Results into somewhat like a={365,299,67,50,21,20,.. blah..}... 2 Well No U hv to put those values to a string variable. Please lemme knw if I need more clarification.. This is simple where is the messy part?? On Fri, Aug 12, 2011 at 6:16 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: radix sort the digits wrong way (left most digit first), and then concatenate On Fri, Aug 12, 2011 at 6:12 PM, Yasir yasir@gmail.com wrote: Kindly check it with both the examples. It won't work. -- 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/-/VlT1DNH-vPkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- Thanks Regards Abhishek Gupta BITS, Pilani -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: You have to count the occurances of all words in a document. You are given a method chat * GetNextWord, that returns the next word from the document.
I will go with Trie or Treap http://en.wikipedia.org/wiki/Treap.It will maintin the order of words as well , we will keep incrementing count of word if appears more then once .If we use trie to find the count it takes o(k) , k being length of the word structure of trie will be like this Class Node { Char Ch; Collection Node LinkedList or Set; boolean endofword(EOW); int count; } Correct me if anything wrong in this ? * Regards Shashank Mani Computer Science Is Awesome So Why I Write Code 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/-/iNjL5lpFKX0J. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] an array question
use something like radix sort, but from numbers left to right. in given example: 87 36 52 87 36 52 place 87 then 52 than 36 if input is something like 9 87 36 52 place 9875236 this you can do with minor modification of radix sort. thanks Rajesh On Fri, Aug 12, 2011 at 6:31 PM, Abhishek Gupta guptaabhishe...@gmail.com wrote: see the second example...if a single digit is there...tht will be at the very end of the array...and if it is 9 it must come at first place...there it goes wrong... On Fri, Aug 12, 2011 at 6:23 PM, Prem Krishna Chettri hprem...@gmail.com wrote: Amazing , Kindly Follow me up :- 1 Given Array of Random Value ... say int a[]= {20,365,299,50,67,21}; Apply Any Sorting Algo on it... which Results into somewhat like a={365,299,67,50,21,20,.. blah..}... 2 Well No U hv to put those values to a string variable. Please lemme knw if I need more clarification.. This is simple where is the messy part?? On Fri, Aug 12, 2011 at 6:16 PM, Nitin Nizhawan nitin.nizha...@gmail.com wrote: radix sort the digits wrong way (left most digit first), and then concatenate On Fri, Aug 12, 2011 at 6:12 PM, Yasir yasir@gmail.com wrote: Kindly check it with both the examples. It won't work. -- 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/-/VlT1DNH-vPkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- Thanks Regards Abhishek Gupta BITS, Pilani -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Value of base pointer VS Address of base pointer
Program: int arr[] = {12, 14, 15, 23, 45}; printf(%u %u\n, arr, arr); Question: Why arr == arr ? Comments: 1. arr is a variable that stores the address of location where arr[0] resides. Complier shows arr and arr having same value. Shouldn't arr be the address where arr resides? Thanks Monish -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] You have to count the occurances of all words in a document. You are given a method chat * GetNextWord, that returns the next word from the document.
@umar u'll have to look back and see if the word already exists in the list. if i am correct we need not to look up back , because when u will insert words in dictionary (ordered or trie) , our algo will make sure that if word already exist if yes increment corresponding count else insert node with zero count .its all pr4eprocessing step .isn't it ? our function is GetNextWord() only ? Correct me if i interpreted it wrong ? *Regards Shashank Mani Computer Science Is Awesome So Why I Write Code 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/-/29F0D6mdv-cJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Adobe Internship
Hi all Can anyone tell me abiut the ADOBE internship tests,prroocess followed,questions,etc. Thanking u in advance. Arvind -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Internship
*process On Fri, Aug 12, 2011 at 6:46 PM, arvind kumar arvindk...@gmail.com wrote: Hi all Can anyone tell me abiut the ADOBE internship tests,prroocess followed,questions,etc. Thanking u in advance. Arvind -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] You have to count the occurances of all words in a document. You are given a method chat * GetNextWord, that returns the next word from the document.
@mukesh done :D On Fri, Aug 12, 2011 at 1:07 PM, Mukesh kumar mukeshraj8...@gmail.comwrote: Hi all, i want to unsubscribe from this group.kindly make me out of this group. now i am feeling little iritation from these mails.so please ..do thid needful On 3/5/10, Umer Farooq the.um...@gmail.com wrote: Thanks for lettimg me know that. Although I have used this kinda thingy in solving a lot of problems; but, I never knew that it is called a trie. On Thu, Mar 4, 2010 at 8:08 PM, Chakravarthi Muppalla chakri...@gmail.comwrote: @Umer 'categorize the words into 26 categories depending on the initial character', as far as i know this is the principle of a trie. look up trie for the next word, if exists increment count; other wise start counter and insert into trie; i think this one would work. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com algogeeks%2bunsubscr...@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. -- Thanks and Regards Mukesh Kumar +91-9945194097 mukeshraj8...@gmail.com -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Adobe Internship
+1 On Fri, Aug 12, 2011 at 6:48 PM, arvind kumar arvindk...@gmail.com wrote: *process On Fri, Aug 12, 2011 at 6:46 PM, arvind kumar arvindk...@gmail.comwrote: Hi all Can anyone tell me abiut the ADOBE internship tests,prroocess followed,questions,etc. Thanking u in advance. Arvind -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: an array question
@Yasir: I think the following will work. Counterexamples welcome. Find the number of digits in each of the integers, and find the max of that number, say m. Fill a second array as follows: If the ith integer has m digits, copy it into the second array. If the ith number has less than m digits, concatenate duplicates of the last digit of the integer to the right end to expand it to m digits. Examples: m = 3, 7 goes to 777; 82 goes to 822; 29 goes to 299; 0 goes to 000. Sort the second array into descending order and carry the first array along (apply the same permutations to the first array as you do to the second). Concatenate the integers in the first array to get the result. Dave On Aug 12, 7:34 am, Yasir Imteyaz yasir@gmail.com wrote: An array of integers is given and you have to find the largest possible integer by concatenating all elements: example: array: 87 36 52 answer: 875236 array: 87 9 52 answer: 98752 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] an array question
I have use bactracking http://codepad.org/rF4Sr3zk it works for only 1 and 2digit number On Fri, Aug 12, 2011 at 6:04 PM, Yasir Imteyaz yasir@gmail.com wrote: An array of integers is given and you have to find the largest possible integer by concatenating all elements: example: array: 87 36 52 answer: 875236 array: 87 9 52 answer: 98752 -- 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/-/_lJJOlRG_ukJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] iocl recruitment process
If you are in top 5 in your coe branch then dont take stress and if not then dont worry about process bcoz they take only 2-3 student from top 5 each year in GEN category . On Fri, Aug 12, 2011 at 12:34 PM, coder coder i.code.program...@gmail.comwrote: iocl is coming to my college please any dceite please tell what they are asking in their interview process and what profile they are offering to the coe candidate -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] output
macro has not been terminated and it has so many errors On Thu, Aug 11, 2011 at 11:36 PM, manvir siyo manis...@gmail.com wrote: output of the program? #define prn(a) printf(%d,a) #define print(a,b,c) prn(a), prn(b), prn(c) #define max(a,b) (a main() { int x=1, y=2; print(max(x++,y),x,y); print(max(x++,y),x,y); } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] cisco
can anybody tell abt the interview process in cisco ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] cisco
is CISCO cuming fr recruitment ?? they are in huge loss and they have sacked around 1 employees . On Fri, Aug 12, 2011 at 7:18 PM, sukran dhawan sukrandha...@gmail.comwrote: can anybody tell abt the interview process in cisco ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Amazon question.
@Dave How is the complexity O(n^2logn) .. Can you please tell I believe there cant be solution better than O(n^2) unless u use FFT which again is out of scope , at least for me :) Regards Ankur 2011/8/11 Samba Ganapavarapu sambasiv...@gmail.com Can we find any alg. which runs faster than O(n^2) using these 2 axioms ? 2011/8/10 Amethy hobby news...@gmail.com it also like Pythagorean theorem; so the a[k] also with the value where a[j]-a[i]a[k]a[i]+a[j] and a[k]a[j]=a[i]; On 8月9日, 下午10时43分, Samba Ganapavarapu sambasiv...@gmail.com wrote: We have an array of integers, we need to find the element a[i],a[j] and a[k] values where.. a[i]^2 + a[k]^2 = a[k] ^2 what would be the fast algorithm to find ? - Samba -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: an array question
@dave, Awesome approach. It was really tough to find a counter example. :D 1st number: 23 2nd number: 23235 Applying ur algo: 23 - 2 -- 23235 Answer using ur algo: 2323235 However the correct answer should be: 2323523 Am I missing something in the above example? :-/ -- 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/-/tJyt_fkHU-kJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 spaces
ankit. flag ko wapis 0 kaun karega? pehle code ko run karke check karna chahiye na.. ! mean multiple spaces jaruri nahi ki ek hi baar ho :P On Fri, Aug 12, 2011 at 4:05 PM, ankit sambyal ankitsamb...@gmail.comwrote: void delExtraSpaces (char *Str) { int Pntr = 0; int Dest = 0; int flag=0; while (Str [Pntr]) { if (Str [Pntr] != ' ') { Str [Dest++] = Str [Pntr]; flag=0; } else if(Str[Ptr]==' ' flag==1) Str [Dest++] = Str [Pntr]; else flag=1; Pntr++; } Str [Pntr] = '/0'; } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **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: Jumping Puzzle
A Top Down Memoization DP Algorithm Will be As Follow Step 1. Declare an array of size N say jump[N]; where ith position indicates the number of jumps requires to reach from start to this (ith) position in array . Step 2. Initialize jump[0]=0; indicates to reach oth location form starting location (3which is obviuosly 0) we don't requires any jump. Step 3. Check size of array and value at 0th location in array For first index, optimum number of jumps will be zero. Please note that if value at first index is zero, we can’t jump to any element and return infinite.so these tow cases are A.If size of array==0 means array is of zero size; B.If value at zero then we can't jump or we can't proceed to next location Step 4. Run Through Loop for remaining elements in array and Initialize jump[i] as infinite. where 1=i=N. Sub-step 4A. (Please Note j runs in inner loop until i*=j+a[j] ) if jump[i]jump[j]+1 update jump[i] repeat until ji (this whole processing will happen in inner loop). e.g. for each ith element this loop will run tries to figure out optimal/minimum number of jumps required to reach this ith position from starting of array . Step 5. After running above algorithm we will return array[n-1] that will show number of jumps required to reach last elemnt in array from start. Time Complexity O(N^2) Space Complexity O(N) Hope You Can Convert it into Production Code Do Notify me via mail if i missed anything ?? **Regards Shashank Mani Computer Science Is Awesome So Why I Write Code 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/-/37L_lAEKGVkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] an array question
I think tis works On Fri, Aug 12, 2011 at 6:16 PM, Nitin Nizhawan nitin.nizha...@gmail.comwrote: radix sort the digits wrong way (left most digit first), and then concatenate On Fri, Aug 12, 2011 at 6:12 PM, Yasir yasir@gmail.com wrote: Kindly check it with both the examples. It won't work. -- 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/-/VlT1DNH-vPkJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] output
this is the question : #includestdio.h #define prn(a) printf(%d,a) #define print(a,b,c) prn(a), prn(b), prn(c) #define max(a,b) (ab?a:b) int main() { int x=1, y=2; print(max(x++,y),x,y); print(max(x++,y),x,y); return 0; } -- 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/-/bL-fhH-lTmQJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 spaces
The code is buggy.. anyways the idea is to maintain two indexes one which points to the string upto which spaces have been removed and one which travels with a constant pace,,, Kindly share the ideas with codesWriting code is a kid's affair. On Fri, Aug 12, 2011 at 7:45 PM, sagar pareek sagarpar...@gmail.com wrote: ankit. flag ko wapis 0 kaun karega? pehle code ko run karke check karna chahiye na.. ! mean multiple spaces jaruri nahi ki ek hi baar ho :P On Fri, Aug 12, 2011 at 4:05 PM, ankit sambyal ankitsamb...@gmail.comwrote: void delExtraSpaces (char *Str) { int Pntr = 0; int Dest = 0; int flag=0; while (Str [Pntr]) { if (Str [Pntr] != ' ') { Str [Dest++] = Str [Pntr]; flag=0; } else if(Str[Ptr]==' ' flag==1) Str [Dest++] = Str [Pntr]; else flag=1; Pntr++; } Str [Pntr] = '/0'; } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **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. -- 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.
Re: [algogeeks] cisco
On 12 August 2011 19:20, aditya kumar aditya.kumar130...@gmail.com wrote: is CISCO cuming fr recruitment ?? they are in huge loss and they have sacked around 1 employees . well, this is what Goldman Sachs also did, but they are also doing recruitment. No company virtually ever stops recruitment. Sacking is done to fill space with less expensive resources (though clearly a bad indicator) On Fri, Aug 12, 2011 at 7:18 PM, sukran dhawan sukrandha...@gmail.comwrote: can anybody tell abt the interview process in cisco ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Siddharth Srivastava -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 spaces
sorry i missed the flag=0 in line 11... but still ur code is not correct.. here is my code. * * *#includestdio.h #includestring.h main() { int i,l,j=0,count=0; char str[100]=hi! howare you? I m fine so say whats goin on??? :P; //printf(enter the string:- ); //fgets(str,100,stdin); l=strlen(str); for(i=0;il;i++) { if(str[i]!=' ') { str[j++]=str[i]; count=0; } else if(str[i]==' '!count) { str[j++]=str[i]; count=1; } } str[j]='\0'; printf http://www.opengroup.org/onlinepubs/009695399/functions/printf.html(New string is :- %s\n,str); } * On Fri, Aug 12, 2011 at 7:45 PM, sagar pareek sagarpar...@gmail.com wrote: ankit. flag ko wapis 0 kaun karega? pehle code ko run karke check karna chahiye na.. ! mean multiple spaces jaruri nahi ki ek hi baar ho :P On Fri, Aug 12, 2011 at 4:05 PM, ankit sambyal ankitsamb...@gmail.comwrote: void delExtraSpaces (char *Str) { int Pntr = 0; int Dest = 0; int flag=0; while (Str [Pntr]) { if (Str [Pntr] != ' ') { Str [Dest++] = Str [Pntr]; flag=0; } else if(Str[Ptr]==' ' flag==1) Str [Dest++] = Str [Pntr]; else flag=1; Pntr++; } Str [Pntr] = '/0'; } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **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] Remove spaces
Guys sorry for posting the buggy code . Here is the working code : void delExtraSpaces (char Str[]) { int Pntr = 0; int Dest = 0; int flag=0; while (Str[Pntr]!='\0') { if (Str[Pntr] != ' ') { Str[Dest++] = Str[Pntr]; flag=0; } else if(Str[Pntr]==' ' flag==0) { Str[Dest++] = Str[Pntr]; flag=1; } Pntr++; } Str[Dest] = '\0'; } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Goldman sachs _ DCE _ 10 AUGUST
All DCE students are requested to upload the interview / written questions which were asked by goldman sachs on 10 aug 2011 for internship thanks in advance . -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Re: microsoft paper that i wrote today..
thanks a lot mate . On Aug 11, 4:51 pm, sindhu sindhu...@gmail.com wrote: 1. write a method to find the smallest angle between two hands when the time is given as input??? 2. given a number between 1 to 1000 convert it to words..example 235..it should print as two hundred thirty five.. 3. write test cases for elevator in a multistory building.. 4. a chessboard of size 64 blocks is given..a knight can move two n half moves at a time..how many steps will it take to cover all the 64 blocks...and change the algorithm if the knight moves three and a half moves. 5. what will be the result if you execute the following code segment: 1+2+4 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 help
as i told download the book called cracking the coding interview , if you read/workout the problems thats enough, i feel. Thank you, Siddharam On Fri, Aug 12, 2011 at 5:53 PM, WgpShashank shashank7andr...@gmail.comwrote: @Prem, akashmkj, Thanks Geeks, Whenever you read any post , do notify me via mail or comment in post if anything wrong in post, i think this the best way to test algorithm for different test cases making that efficient . * Regards Shashank Mani Computer Science Is Awesome So Why I Write Code 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/-/GcwGtM_RntQJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] logic???????????
oh common shashank...its not that easy u told. just do codingthen u will find the error in ur logic On Fri, Aug 12, 2011 at 6:25 PM, WgpShashank shashank7andr...@gmail.comwrote: Hi Guys Here is the algorithm for doing same in O(logn) Hint : Find the pivot point, divide the array in two sub-arrays and call binary search. Thats It :) Algorithm 1. A Pivot Point is point around which array is rotated so 1st we need to find out its location/index. lets say it pivot. a. to find pivot point we use same idea of binary search check if arr[mid]a[mid+1] if true then return pivot=mid. b else if arr[low]a[mid] search for pivot in left c. else search for pivot in right half of array. Time Complexity O(logn) 2. Once we have found index of pivot point check if desired element is same value at pivot index or not e.g. a. ( if a[pivot]==value we are searching for ) the simply return true or 1 . Now call binary search for one of the two sub-arrays. (ab) *If *element is greater than 0th element then search in left array (ac) *Else* Search in right array * (ad) If *element is found in selected sub-array then return index *Else *return -1. Again Time Complexity O(logn) Hope You Can Make it in Running Code , Do Noify me if You Need More Explanation or if missed Something?? *Regards Shashank Mani Computer Science Is Awesome So Why I Write Code 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/-/QPCzNLNf_sEJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Remove spaces
If its allowed in Haskell then only one line is enough. import Data.List stringWithspace :: String - String stringWithspace xs = unwords.words $ xs You can run this program on ideone [ http://ideone.com/RloOE ] On Aug 12, 8:00 pm, ankit sambyal ankitsamb...@gmail.com wrote: Guys sorry for posting the buggy code . Here is the working code : void delExtraSpaces (char Str[]) { int Pntr = 0; int Dest = 0; int flag=0; while (Str[Pntr]!='\0') { if (Str[Pntr] != ' ') { Str[Dest++] = Str[Pntr]; flag=0;} else if(Str[Pntr]==' ' flag==0) { Str[Dest++] = Str[Pntr]; flag=1; } Pntr++; } Str[Dest] = '\0'; } -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Design .. how to attack ???
if someone can share one good solution , it would really help me. I am unable to form the answer to these questions --mac On Fri, Aug 12, 2011 at 1:15 PM, MAC macatad...@gmail.com wrote: thanks guys .. so lets take the question we had design a car rental system .. so the interviewer can say , ok requirement is that you have a pool of cars , people come and book a car for a particular time slot if available . This is the most basic thing . so now what , what shd i do next --mac On Fri, Aug 12, 2011 at 1:11 PM, keyan karthi keyankarthi1...@gmail.comwrote: First thing tat should come to your mind s ' requirements ' ask him wat de requirements are. He will expect tat.. On 8/12/11, MAC macatad...@gmail.com wrote: Hi guys , Can anyone help me in understanding what is expected when some some one asks you design a car rental system . Exactly what all is required to be told to the interviewer . -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sent from my mobile device -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- thanks --mac -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: need the book google resume and algorithms for interviews
pls do send the algorithm for interviews book to this email id.. prasat...@live.com pls... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: If anyone have this book please mail me Thanks in advance
pls do share the book named Algorithm for interviews.. ebook pls -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: logic???????????
Check this out //But this and fails for input such as: 101 ie all nos must be unique.. int search_element_in_rotated_array(int *a, int low, int high, int key) { while(low = high) { int mid = low + (high - low)/2; if(a[mid] == key) return mid; if(a[mid] = a[low]) // the top part is sorted { if(a[low] = key key a[mid]) high = mid - 1; else low = mid + 1; } else { if(key = a[high] key a[mid]) low = mid + 1; else high = mid - 1; } } return -1; } On Aug 12, 8:38 pm, sagar pareek sagarpar...@gmail.com wrote: oh common shashank...its not that easy u told. just do codingthen u will find the error in ur logic On Fri, Aug 12, 2011 at 6:25 PM, WgpShashank shashank7andr...@gmail.comwrote: Hi Guys Here is the algorithm for doing same in O(logn) Hint : Find the pivot point, divide the array in two sub-arrays and call binary search. Thats It :) Algorithm 1. A Pivot Point is point around which array is rotated so 1st we need to find out its location/index. lets say it pivot. a. to find pivot point we use same idea of binary search check if arr[mid]a[mid+1] if true then return pivot=mid. b else if arr[low]a[mid] search for pivot in left c. else search for pivot in right half of array. Time Complexity O(logn) 2. Once we have found index of pivot point check if desired element is same value at pivot index or not e.g. a. ( if a[pivot]==value we are searching for ) the simply return true or 1 . Now call binary search for one of the two sub-arrays. (ab) *If *element is greater than 0th element then search in left array (ac) *Else* Search in right array * (ad) If *element is found in selected sub-array then return index *Else *return -1. Again Time Complexity O(logn) Hope You Can Make it in Running Code , Do Noify me if You Need More Explanation or if missed Something?? *Regards Shashank Mani Computer Science Is Awesome So Why I Write Code 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/-/QPCzNLNf_sEJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] cisco
On Fri, Aug 12, 2011 at 8:16 PM, siddharth srivastava akssps...@gmail.comwrote: On 12 August 2011 19:20, aditya kumar aditya.kumar130...@gmail.comwrote: is CISCO cuming fr recruitment ?? they are in huge loss and they have sacked around 1 employees . well, this is what Goldman Sachs also did, but they are also doing recruitment. No company virtually ever stops recruitment. Sacking is done to fill space with less expensive resources (though clearly a bad indicator) well,cisco off campus for s/w engg had written test,followed by G.D and two interviews written test consists of 50 questions,sections coverin those questions were 1.general aps, 2.Networking ,3.sqa, 4.c programmin On Fri, Aug 12, 2011 at 7:18 PM, sukran dhawan sukrandha...@gmail.comwrote: can anybody tell abt the interview process in cisco ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Siddharth Srivastava -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: logic???????????
nope it will not work top kya lower part bhi sorted hai.. like 7 8 9 1 2 3 4 5 6 do it with this i/p... it will fail ur algo will do same thing for 8 and 4 FAIL !!! On Fri, Aug 12, 2011 at 9:27 PM, KK kunalkapadi...@gmail.com wrote: Check this out //But this and fails for input such as: 101 ie all nos must be unique.. int search_element_in_rotated_array(int *a, int low, int high, int key) { while(low = high) { int mid = low + (high - low)/2; if(a[mid] == key) return mid; if(a[mid] = a[low]) // the top part is sorted { if(a[low] = key key a[mid]) high = mid - 1; else low = mid + 1; } else { if(key = a[high] key a[mid]) low = mid + 1; else high = mid - 1; } } return -1; } On Aug 12, 8:38 pm, sagar pareek sagarpar...@gmail.com wrote: oh common shashank...its not that easy u told. just do codingthen u will find the error in ur logic On Fri, Aug 12, 2011 at 6:25 PM, WgpShashank shashank7andr...@gmail.com wrote: Hi Guys Here is the algorithm for doing same in O(logn) Hint : Find the pivot point, divide the array in two sub-arrays and call binary search. Thats It :) Algorithm 1. A Pivot Point is point around which array is rotated so 1st we need to find out its location/index. lets say it pivot. a. to find pivot point we use same idea of binary search check if arr[mid]a[mid+1] if true then return pivot=mid. b else if arr[low]a[mid] search for pivot in left c. else search for pivot in right half of array. Time Complexity O(logn) 2. Once we have found index of pivot point check if desired element is same value at pivot index or not e.g. a. ( if a[pivot]==value we are searching for ) the simply return true or 1 . Now call binary search for one of the two sub-arrays. (ab) *If *element is greater than 0th element then search in left array (ac) *Else* Search in right array * (ad) If *element is found in selected sub-array then return index *Else *return -1. Again Time Complexity O(logn) Hope You Can Make it in Running Code , Do Noify me if You Need More Explanation or if missed Something?? *Regards Shashank Mani Computer Science Is Awesome So Why I Write Code 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/-/QPCzNLNf_sEJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: microsoft paper that i wrote today..
wats the ans to the 5th ques?? On Fri, Aug 12, 2011 at 8:54 PM, gaurav kumar mailmea...@gmail.com wrote: thanks a lot mate . On Aug 11, 4:51 pm, sindhu sindhu...@gmail.com wrote: 1. write a method to find the smallest angle between two hands when the time is given as input??? 2. given a number between 1 to 1000 convert it to words..example 235..it should print as two hundred thirty five.. 3. write test cases for elevator in a multistory building.. 4. a chessboard of size 64 blocks is given..a knight can move two n half moves at a time..how many steps will it take to cover all the 64 blocks...and change the algorithm if the knight moves three and a half moves. 5. what will be the result if you execute the following code segment: 1+2+4 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aditi Garg Undergraduate Student Electronics Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: microsoft paper that i wrote today..
well if we write the code simply as #includestdio.h int main() { 1+2+4 } it gives compilation error if like this #includestdio.h int main() { 1+2+4; } it will give warning:- no effect of code if like this #includestdio.h int main() { int a= 1+2+4; printf(%d,a); } it will give error cannot convert char* to int On Fri, Aug 12, 2011 at 10:44 PM, aditi garg aditi.garg.6...@gmail.comwrote: wats the ans to the 5th ques?? On Fri, Aug 12, 2011 at 8:54 PM, gaurav kumar mailmea...@gmail.comwrote: thanks a lot mate . On Aug 11, 4:51 pm, sindhu sindhu...@gmail.com wrote: 1. write a method to find the smallest angle between two hands when the time is given as input??? 2. given a number between 1 to 1000 convert it to words..example 235..it should print as two hundred thirty five.. 3. write test cases for elevator in a multistory building.. 4. a chessboard of size 64 blocks is given..a knight can move two n half moves at a time..how many steps will it take to cover all the 64 blocks...and change the algorithm if the knight moves three and a half moves. 5. what will be the result if you execute the following code segment: 1+2+4 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aditi Garg Undergraduate Student Electronics Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **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 paper that i wrote today..
Q.5 . [warning] initialization makes integer from pointer without a cast. On Fri, Aug 12, 2011 at 10:56 PM, sagar pareek sagarpar...@gmail.comwrote: well if we write the code simply as #includestdio.h int main() { 1+2+4 } it gives compilation error if like this #includestdio.h int main() { 1+2+4; } it will give warning:- no effect of code if like this #includestdio.h int main() { int a= 1+2+4; printf(%d,a); } it will give error cannot convert char* to int On Fri, Aug 12, 2011 at 10:44 PM, aditi garg aditi.garg.6...@gmail.comwrote: wats the ans to the 5th ques?? On Fri, Aug 12, 2011 at 8:54 PM, gaurav kumar mailmea...@gmail.comwrote: thanks a lot mate . On Aug 11, 4:51 pm, sindhu sindhu...@gmail.com wrote: 1. write a method to find the smallest angle between two hands when the time is given as input??? 2. given a number between 1 to 1000 convert it to words..example 235..it should print as two hundred thirty five.. 3. write test cases for elevator in a multistory building.. 4. a chessboard of size 64 blocks is given..a knight can move two n half moves at a time..how many steps will it take to cover all the 64 blocks...and change the algorithm if the knight moves three and a half moves. 5. what will be the result if you execute the following code segment: 1+2+4 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aditi Garg Undergraduate Student Electronics Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **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. -- Anil Kumar Arya computer science engineering M.N.N.I.T 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 paper that i wrote today..
thanks:) On Fri, Aug 12, 2011 at 11:06 PM, Anil Arya anilarya...@gmail.com wrote: Q.5 . [warning] initialization makes integer from pointer without a cast. On Fri, Aug 12, 2011 at 10:56 PM, sagar pareek sagarpar...@gmail.comwrote: well if we write the code simply as #includestdio.h int main() { 1+2+4 } it gives compilation error if like this #includestdio.h int main() { 1+2+4; } it will give warning:- no effect of code if like this #includestdio.h int main() { int a= 1+2+4; printf(%d,a); } it will give error cannot convert char* to int On Fri, Aug 12, 2011 at 10:44 PM, aditi garg aditi.garg.6...@gmail.comwrote: wats the ans to the 5th ques?? On Fri, Aug 12, 2011 at 8:54 PM, gaurav kumar mailmea...@gmail.comwrote: thanks a lot mate . On Aug 11, 4:51 pm, sindhu sindhu...@gmail.com wrote: 1. write a method to find the smallest angle between two hands when the time is given as input??? 2. given a number between 1 to 1000 convert it to words..example 235..it should print as two hundred thirty five.. 3. write test cases for elevator in a multistory building.. 4. a chessboard of size 64 blocks is given..a knight can move two n half moves at a time..how many steps will it take to cover all the 64 blocks...and change the algorithm if the knight moves three and a half moves. 5. what will be the result if you execute the following code segment: 1+2+4 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aditi Garg Undergraduate Student Electronics Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **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. -- Anil Kumar Arya computer science engineering M.N.N.I.T 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. -- Aditi Garg Undergraduate Student Electronics Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: microsoft paper that i wrote today..
just wondering...is there a standard ans to Q3 ? On 12 August 2011 23:11, aditi garg aditi.garg.6...@gmail.com wrote: thanks:) On Fri, Aug 12, 2011 at 11:06 PM, Anil Arya anilarya...@gmail.com wrote: Q.5 . [warning] initialization makes integer from pointer without a cast. On Fri, Aug 12, 2011 at 10:56 PM, sagar pareek sagarpar...@gmail.comwrote: well if we write the code simply as #includestdio.h int main() { 1+2+4 } it gives compilation error if like this #includestdio.h int main() { 1+2+4; } it will give warning:- no effect of code if like this #includestdio.h int main() { int a= 1+2+4; printf(%d,a); } it will give error cannot convert char* to int On Fri, Aug 12, 2011 at 10:44 PM, aditi garg aditi.garg.6...@gmail.comwrote: wats the ans to the 5th ques?? On Fri, Aug 12, 2011 at 8:54 PM, gaurav kumar mailmea...@gmail.comwrote: thanks a lot mate . On Aug 11, 4:51 pm, sindhu sindhu...@gmail.com wrote: 1. write a method to find the smallest angle between two hands when the time is given as input??? 2. given a number between 1 to 1000 convert it to words..example 235..it should print as two hundred thirty five.. 3. write test cases for elevator in a multistory building.. 4. a chessboard of size 64 blocks is given..a knight can move two n half moves at a time..how many steps will it take to cover all the 64 blocks...and change the algorithm if the knight moves three and a half moves. 5. what will be the result if you execute the following code segment: 1+2+4 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aditi Garg Undergraduate Student Electronics Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **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. -- Anil Kumar Arya computer science engineering M.N.N.I.T 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. -- Aditi Garg Undergraduate Student Electronics Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Regards Siddharth Srivastava -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: need the book google resume and algorithms for interviews
pls send me too algorithm for interviews book. link. On 8/12/11, sarath prasath prasathsar...@gmail.com wrote: pls do send the algorithm for interviews book to this email id.. prasat...@live.com pls... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] cisco
@ aditya, Cisco is not in losses they make better profit then expected by the market this quarter share rises by 16% after results. Moreover cisco sacked only 2200 employees and some 2-3k took VRS. On Fri, Aug 12, 2011 at 9:58 PM, Nanda Kishore nanda.kishore...@gmail.comwrote: On Fri, Aug 12, 2011 at 8:16 PM, siddharth srivastava akssps...@gmail.com wrote: On 12 August 2011 19:20, aditya kumar aditya.kumar130...@gmail.comwrote: is CISCO cuming fr recruitment ?? they are in huge loss and they have sacked around 1 employees . well, this is what Goldman Sachs also did, but they are also doing recruitment. No company virtually ever stops recruitment. Sacking is done to fill space with less expensive resources (though clearly a bad indicator) well,cisco off campus for s/w engg had written test,followed by G.D and two interviews written test consists of 50 questions,sections coverin those questions were 1.general aps, 2.Networking ,3.sqa, 4.c programmin On Fri, Aug 12, 2011 at 7:18 PM, sukran dhawan sukrandha...@gmail.comwrote: can anybody tell abt the interview process in cisco ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Siddharth Srivastava -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- Cheers Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: logic???????????
how abt http://ideone.com/lN2og ?? -- 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/-/pZdvFb_t2b4J. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Design .. how to attack ???
+1..me too need answers for this On Fri, Aug 12, 2011 at 11:39 AM, MAC macatad...@gmail.com wrote: if someone can share one good solution , it would really help me. I am unable to form the answer to these questions --mac On Fri, Aug 12, 2011 at 1:15 PM, MAC macatad...@gmail.com wrote: thanks guys .. so lets take the question we had design a car rental system .. so the interviewer can say , ok requirement is that you have a pool of cars , people come and book a car for a particular time slot if available . This is the most basic thing . so now what , what shd i do next --mac On Fri, Aug 12, 2011 at 1:11 PM, keyan karthi keyankarthi1...@gmail.comwrote: First thing tat should come to your mind s ' requirements ' ask him wat de requirements are. He will expect tat.. On 8/12/11, MAC macatad...@gmail.com wrote: Hi guys , Can anyone help me in understanding what is expected when some some one asks you design a car rental system . Exactly what all is required to be told to the interviewer . -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sent from my mobile device -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- thanks --mac -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
[algogeeks] Factorial Algorithms
http://www.luschny.de/math/factorial/FastFactorialFunctions.htm Does anyone know of resource for good/detailed explanation of factorial algorithms on this site? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Design .. how to attack ???
As far as a Design Question like this is concerned: 1) Design a base class car class Car { String model; String make; String carSegment; // SUV, MUV, Sedans, Hatchbacks etc String seats; boolean bookingStatus; // Booked or not ... public assignToCustomer (String custID) {...} } 2) Design a class customer class Customer { String name; String custID; ... } 3) Design a class that handles reservationMgmt class ReservationMgmt { // Map String, String query; // use this to store query params. User may give more than one search criterias public ListCar checkCarAvailability (Date startDate, Date endDate, MapString, String query) { ... Logic goes here } // Now make a reservation using that list retrieved from query public void makeReservation (ListCar availableCars) { ... } } // End of class Then comes a trickier part: Designing a DB Schema for this system (WHICH customer has reserved WHICH car from WHICH startDate to WHICH endDate), which should be normalized. (If you design a basic one, the interviewer expects you to improve it) *The solution above is a VERY simple one. You can put in all your creativity to design this.* ;) *PS. If you really want to make an impression, try using some Design Patterns (iff applicable to the Problem Statement)* On Fri, Aug 12, 2011 at 11:39 PM, Ankur Garg ankurga...@gmail.com wrote: +1..me too need answers for this On Fri, Aug 12, 2011 at 11:39 AM, MAC macatad...@gmail.com wrote: if someone can share one good solution , it would really help me. I am unable to form the answer to these questions --mac On Fri, Aug 12, 2011 at 1:15 PM, MAC macatad...@gmail.com wrote: thanks guys .. so lets take the question we had design a car rental system .. so the interviewer can say , ok requirement is that you have a pool of cars , people come and book a car for a particular time slot if available . This is the most basic thing . so now what , what shd i do next --mac On Fri, Aug 12, 2011 at 1:11 PM, keyan karthi keyankarthi1...@gmail.com wrote: First thing tat should come to your mind s ' requirements ' ask him wat de requirements are. He will expect tat.. On 8/12/11, MAC macatad...@gmail.com wrote: Hi guys , Can anyone help me in understanding what is expected when some some one asks you design a car rental system . Exactly what all is required to be told to the interviewer . -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Sent from my mobile device -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- thanks --mac -- thanks --mac -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] output
Answer=: 32 On Fri, Aug 12, 2011 at 8:05 PM, Avenged nitee...@gmail.com wrote: this is the question : #includestdio.h #define prn(a) printf(%d,a) #define print(a,b,c) prn(a), prn(b), prn(c) #define max(a,b) (ab?a:b) int main() { int x=1, y=2; print(max(x++,y),x,y); print(max(x++,y),x,y); return 0; } -- 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/-/bL-fhH-lTmQJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Anil Kumar Arya computer science engineering -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: microsoft paper that i wrote today..
Ques 5 might be value of 1+2+'4' https://ideone.com/8b91t Obviously if we use , then it represents string and we can't define + operation with other operand being an integer. On Fri, Aug 12, 2011 at 11:06 PM, Anil Arya anilarya...@gmail.com wrote: Q.5 . [warning] initialization makes integer from pointer without a cast. On Fri, Aug 12, 2011 at 10:56 PM, sagar pareek sagarpar...@gmail.comwrote: well if we write the code simply as #includestdio.h int main() { 1+2+4 } it gives compilation error if like this #includestdio.h int main() { 1+2+4; } it will give warning:- no effect of code if like this #includestdio.h int main() { int a= 1+2+4; printf(%d,a); } it will give error cannot convert char* to int On Fri, Aug 12, 2011 at 10:44 PM, aditi garg aditi.garg.6...@gmail.comwrote: wats the ans to the 5th ques?? On Fri, Aug 12, 2011 at 8:54 PM, gaurav kumar mailmea...@gmail.comwrote: thanks a lot mate . On Aug 11, 4:51 pm, sindhu sindhu...@gmail.com wrote: 1. write a method to find the smallest angle between two hands when the time is given as input??? 2. given a number between 1 to 1000 convert it to words..example 235..it should print as two hundred thirty five.. 3. write test cases for elevator in a multistory building.. 4. a chessboard of size 64 blocks is given..a knight can move two n half moves at a time..how many steps will it take to cover all the 64 blocks...and change the algorithm if the knight moves three and a half moves. 5. what will be the result if you execute the following code segment: 1+2+4 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aditi Garg Undergraduate Student Electronics Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **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. -- Anil Kumar Arya computer science engineering M.N.N.I.T 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] an array question
int compare(int a, int b) { string s = Integer.tostring(a); string y = Integer.tostring(b); if (s +y y+s) return -1; else return 1; } use this to write quick sort , you can get the answer. On Fri, Aug 12, 2011 at 8:34 PM, Yasir Imteyaz yasir@gmail.com wrote: An array of integers is given and you have to find the largest possible integer by concatenating all elements: example: array: 87 36 52 answer: 875236 array: 87 9 52 answer: 98752 -- 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/-/_lJJOlRG_ukJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- stay hungry stay foolish Chengjie Qi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] cisco
I think CISCO sacked the employees in 'Flip' Deptt. (as it appears on Web). Flip was something out of networking domain, and it failed. So CISCO is now refocusing on their networking infrastructure and networking products that it is famous for. Lets hope hiring will continue the same as last year. On 12 August 2011 23:37, Naveen Kumar naveenkumarve...@gmail.com wrote: @ aditya, Cisco is not in losses they make better profit then expected by the market this quarter share rises by 16% after results. Moreover cisco sacked only 2200 employees and some 2-3k took VRS. On Fri, Aug 12, 2011 at 9:58 PM, Nanda Kishore nanda.kishore...@gmail.com wrote: On Fri, Aug 12, 2011 at 8:16 PM, siddharth srivastava akssps...@gmail.com wrote: On 12 August 2011 19:20, aditya kumar aditya.kumar130...@gmail.comwrote: is CISCO cuming fr recruitment ?? they are in huge loss and they have sacked around 1 employees . well, this is what Goldman Sachs also did, but they are also doing recruitment. No company virtually ever stops recruitment. Sacking is done to fill space with less expensive resources (though clearly a bad indicator) well,cisco off campus for s/w engg had written test,followed by G.D and two interviews written test consists of 50 questions,sections coverin those questions were 1.general aps, 2.Networking ,3.sqa, 4.c programmin On Fri, Aug 12, 2011 at 7:18 PM, sukran dhawan sukrandha...@gmail.comwrote: can anybody tell abt the interview process in cisco ? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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 Siddharth Srivastava -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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. -- Cheers Naveen Kumar -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- ___ Please do not print this e-mail until urgent requirement. Go Green!! Save Papers = Save Trees -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: microsoft paper that i wrote today..
@ Neeraj: 1+2+'4' will be very simple to calculate: 3+48+4 = 55 But 1+2+4 is a good question. On 13 August 2011 06:10, Neeraj Gupta neeraj.gupta...@gmail.com wrote: Ques 5 might be value of 1+2+'4' https://ideone.com/8b91t Obviously if we use , then it represents string and we can't define + operation with other operand being an integer. On Fri, Aug 12, 2011 at 11:06 PM, Anil Arya anilarya...@gmail.com wrote: Q.5 . [warning] initialization makes integer from pointer without a cast. On Fri, Aug 12, 2011 at 10:56 PM, sagar pareek sagarpar...@gmail.comwrote: well if we write the code simply as #includestdio.h int main() { 1+2+4 } it gives compilation error if like this #includestdio.h int main() { 1+2+4; } it will give warning:- no effect of code if like this #includestdio.h int main() { int a= 1+2+4; printf(%d,a); } it will give error cannot convert char* to int On Fri, Aug 12, 2011 at 10:44 PM, aditi garg aditi.garg.6...@gmail.comwrote: wats the ans to the 5th ques?? On Fri, Aug 12, 2011 at 8:54 PM, gaurav kumar mailmea...@gmail.comwrote: thanks a lot mate . On Aug 11, 4:51 pm, sindhu sindhu...@gmail.com wrote: 1. write a method to find the smallest angle between two hands when the time is given as input??? 2. given a number between 1 to 1000 convert it to words..example 235..it should print as two hundred thirty five.. 3. write test cases for elevator in a multistory building.. 4. a chessboard of size 64 blocks is given..a knight can move two n half moves at a time..how many steps will it take to cover all the 64 blocks...and change the algorithm if the knight moves three and a half moves. 5. what will be the result if you execute the following code segment: 1+2+4 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Aditi Garg Undergraduate Student Electronics Communication Divison NETAJI SUBHAS INSTITUTE OF TECHNOLOGY Sector 3, Dwarka New Delhi -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- **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. -- Anil Kumar Arya computer science engineering M.N.N.I.T 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 -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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: Problems on Linked List
First question: - .Read the data from the first list and put it in a stack - Traverse the next list and compare by reading elements from the stack - This would solve it Second question: - Take an list like 1-2--3-4 - If you are given with 2, juz copy the value and reference of next node(i.e : 3) into 2 and delete the node 3 this would solve it Thanks. On Thu, Aug 11, 2011 at 10:21 AM, Abhishek gupta mailatabhishekgu...@gmail.com wrote: Q2). i think for second question it will be enough to just swap the data of current node to next node, and delete the next node. it will be like, //for swap int temp=current-data; current-data=current-next-data; current-next-data=temp; //for delete struct node *temp; temp=current-next; current-next=current-next-next; free(temp); i think it will be enough even in case of last node. correct me if i am wrong. -- 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/-/N1elA8-W-iUJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en. -- Thanks and regards, Raghavan.K.L http://in.linkedin.com/in/raghavankl -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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] Factorial Algorithms
Thanks for the link. I was unaware of such algorithms. These would come handy in programming contests. On Fri, Aug 12, 2011 at 3:00 PM, Nitin Nizhawan nitin.nizha...@gmail.com wrote: http://www.luschny.de/math/factorial/FastFactorialFunctions.htm Does anyone know of resource for good/detailed explanation of factorial algorithms on this site? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from 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.