更新时间:2018-11-22 16:18作者:李天扬老师
___(4)___; pMemoNode=pCurrentNode
pCurrentNode = nStrCmpRes>0? pCurrentNode-
>pRight : pCurrentNode->pLeft;
}
}
}
pCurrent=new BNODE;
if(pCurrentNode != NULL)
{
memset(pCurrentNode,0,sizeof(BNODE));
strncpy(pCurrentNode->szWord,pszWord,MAX_WORD_LEN-1);
pCurrentNode->nCount=1;
}
if(pMemoNode==NULL)
{
___(5)___; *ppNode= pCurrentNode
}
else if(nStrCmpRes>0)
{
pMemoNode->pRight=pCurrentNode;
}
else
{
pMemoNode->pLeft=pCurrentNode;
}
}
void midorder(FILE* pFile,BNODE* pNode)
{
if(___(6)___) return;!pNode||!pFile
midorder(pFile,pNode->pLeft);
fprintf(pFile,"%s %d\n",pNode->szWord,pNode->nCount);
midorder(pFile,pNode->pRight);
}
void main()
{