| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
perhaps...you've confused yourself...In Reply To:Re:i didn't, bst is enough efficient Posted by:SuperDog at 2005-05-27 21:39:56 while (gets(temp))
{
if (strcmp(temp,"")!=0)
{
total++; //wrong! total is increased every time you successfully fetch a string
putintotree(temp,1);
}
else break;
}
total should be increase here:
if (x<0)
{
if (specie[position].left==0)
specie[position].left=++total;//here!
putintotree(spname,specie[position].left);
}
if (x>0)
{
if (specie[position].right==0)
specie[position].right=++total;//here!
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator