Exemplo n.º 1
0
 int countNodes(TreeNode* root) {
     int left_depth = countLeft(root);
     int right_depth = countRight(root);
     
     if (left_depth == right_depth){
         return ((1 << (left_depth+1)) - 1);
     }
     else{
         return countNodes(root->left)+countNodes(root->right)+1;
     }
     
 }
Exemplo n.º 2
0
void PlaceOrderTodo::checkout()
{
	assert( countLeft() > 0 );
	curIndex++;
}
Exemplo n.º 3
0
void ContractDetailsTodo::checkout()
{
	assert( countLeft() > 0 );
	curIndex++;
}