Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

perhaps...you've confused yourself...

Posted by frkstyc at 2005-05-27 22:03:59
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator