Re: [algogeeks] Nested Function C

2012-10-03 Thread srikanth reddy malipatel
@rahul In Standard C you cant define a function inside another function but you can declare a function inside another function. (so the function can be defined outside the function). Eg:- #includestdio.h void abc() { printf(bac); void abf(); abf(); } void abf() { printf(bas);

Re: [algogeeks] array problem

2012-09-06 Thread srikanth reddy malipatel
post the logic not the code! BTW this problem can be done using segment trees. http://community.topcoder.com/tc?module=Staticd1=tutorialsd2=lowestCommonAncestor On Thu, Sep 6, 2012 at 4:51 PM, bharat b bagana.bharatku...@gmail.comwrote: Its better to write an O(n) solution for this problem

Re: [algogeeks] Finding largest zigzag subsequence

2012-06-08 Thread srikanth reddy malipatel
we should use dp On Fri, Jun 8, 2012 at 5:39 PM, Ratan success.rata...@gmail.com wrote: Thats what the question is about to find the maximum subsequence. i too tried your code with the sample 10,4,12,4,1,43,21,4,1,5,7,23,9 ur code gave the result 10 12 4 43 21

Re: [algogeeks] Finding largest zigzag subsequence

2012-06-08 Thread srikanth reddy malipatel
]; } printf(Length of longest zig-zag subsequence is : %d\n,Max); return 0; } On Fri, Jun 8, 2012 at 5:40 PM, srikanth reddy malipatel srikk...@gmail.com wrote: we should use dp On Fri, Jun 8, 2012 at 5:39 PM, Ratan success.rata...@gmail.com wrote: Thats what the question is about

Re: [algogeeks] Vertical Sum in a given Binary Tree

2012-03-19 Thread srikanth reddy malipatel
hii supraja can u mail me the link for your blog plz. On Sun, Mar 18, 2012 at 6:38 PM, Supraja Jayakumar suprajasank...@gmail.com wrote: Hi Others are also welcome to comment on the code. If links are allowed in algogeeks, I might send my wordpress blog link that explains this problem in

Re: [algogeeks] Puzzle

2012-02-28 Thread srikanth reddy malipatel
{39,41,43,45}incremented by 2 {49,51,53,55}incremented by 2 {64,?,?,?} first number in each set is considered as base number. 3 is for the number of numbers in each set other than base number. so in final set base number is 64 and other 3 numbers are incremented by 2. On Tue, Feb 28,

Re: [algogeeks] Puzzle

2012-02-27 Thread srikanth reddy malipatel
66,68,70 On Mon, Feb 27, 2012 at 6:54 PM, karthikeya s karthikeya.a...@gmail.com wrote: 3, 39, 41, 43, 45, 49, 51, 53, 55, 64, ?, ?, ... (These are successive numbers sharing a common property. No math or outside knowledge is needed.) -- You received this message because you are subscribed