thinker
BAN USER
Questions (1)
Comments (14)
Reputation 120
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
1
of 1 vote
//l=size of array
node *buildbst(int pre[], int &start,int min,int max)
{
if( start>l)
return NULL;
if(preorder[start]>max && preorder[start]<min)
return NULL;
node *root;
root=malloc(sizeof(node));
root->data=pre[start++];
root->left=buildbst(pre,start,min,root->data);
root->right=buildbst(pre,start,root->data,max);
return root;
}
please correct me if i am wrong!
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
Dude is [1,2,3,4,5] preorder of any of the tree u have posted???
- thinker August 15, 2012Just read the question properly before posting anything