{ //长子有兄弟。遍历兄弟,查找是否有值为e的结点。 205
p=p->nextsibling; 206
if(Value(p)==e) 207
return Value(t); 208
EnQueue(q,p); 209
} 210
} 211
} 212
} 213
214 return Nil; //树空或者没找到。 215
} 216
217
TElemType LeftChild(CSTree T,TElemType e) 218
219 { //返回树T中结点值为e的长子。 220
CSTree f; 221
f=Point(T,e); 222
if(f&&f->firstchild) 223
return f->firstchild->data; 224
else 225
226 return Nil; //找不到或为叶结点。 227
} 228
229
TElemType RightSibling(CSTree T,TElemType e) 230
231 { //返回树T中结点值为e的右兄弟。 232
CSTree f; 233
f=Point(T,e); 234
if(f&&f->nextsibling) 235
return f->nextsibling->data; 236
else 237
return Nil; 238
} 239
240
Status InsertChild(CSTree &T,CSTree p,int i,CSTree c) 241
242 { // 初始条件: 树T存在,p指向T中某个结点,1≤i≤p所指结点的度243
244 +1,非空树c与T不相交 245
246 // 操作结果: 插入c为T中p结点的第i棵子树 247