key: use queue
usage: queue<node*> myq; myq.push(); myq.front(); myq.pop()
bool isSameTree(TreeNode *p, TreeNode *q) {
queue<TreeNode*> myq;
myq.push(p);
myq.push(q);
while(!myq.empty()){
TreeNode *t1 = myq.front();
myq.pop();
TreeNode *t2 = myq.front();
myq.pop();
if(t1 == NULL && t2 == NULL) continue; //这里是continue
if(t1 == NULL || t2 == NULL) return false;
if(t1->val != t2->val ) return false;
myq.push(t1->left);
myq.push(t2->left);
myq.push(t1->right);
myq.push(t2->right);
}
return true;
}