socrates
BAN USER
Comments (5)
Reputation 25
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
I am not very much clear about your question but u can find a very good article here which talks about allocator, I didnt go through it fully but its interesting. Once u'll start reading it u'll definetely keep on reading it.
cs.northwestern.edu/~pdinda/icsclass/doc/dsa.pdf
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
1
of 1 vote
int banancedBSTHelper(node* root, bool isBalanced)
{
int leftHight, rightHight;
if(root==0) return 0;
leftHight=banancedBSTHelper(root->left, isBalanced)+1;
rightHight=banancedBSTHelper(root->right, isBalanced)+1;
if(ABS(leftHight-rightHight)>1)
isBalanced=false;
return (leftHight>rightHight)?leftHight:rightHight;
}
bool isBalancedBST(node* root)
{
bool isBalanced=true;
balancedBSTHelper(root, &isBalanced);
return isBalanced;
}
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.
- socrates July 12, 2011