void total_no_col(NODEPTR tmp,int cur_col,int *l,int *r) { if(!tmp) return; if(cur_col<*l) *l=cur_col; if(cur_col>*r) *r=cur_col; total_no_col(tmp->left,cur_col-1,l,r); total_no_col(tmp->right,cur_col+1,l,r); }
void sumofcol(NODEPTR tmp,int cur_col,int sum[]) { if(!tmp) return; sum[cur_col]+=tmp->data; sumofcol(tmp->left,cur_col-1,sum); sumofcol(tmp->right,cur_col+1,sum); } -- 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.