Re: [algogeeks] design_algo

2010-11-03 Thread MOHIT ....
1. int main(){ int max=0; int max_till_here=0; for(i=0;i0){ if(max_till_here>max) max=max_till_here; // update maximum sum till here } else { // in case continuous sum cums to <=0; max_till_here=0; } return max; } 2. BST ... i think y

[algogeeks] design_algo

2010-11-02 Thread kanika suri
1.Given an array[0,n-1] of size n.Write an algorithm that finds the sum of continuous subsequence that result in largest sum(among all such sequences) and return 0 if all integers are zero or negative. 2.Given a BST.Write an algorithm that finds the 4h smallest element.(is dere ne approach odr than