recycle_carlbin 0 Newbie Poster

This code will run but it has some errors in it( I mean,logically wrong.) What is its error? Can you help me figure it out?

void preOrder(){
	myPreOrderTraversal(this);
}
int myPreOrderTraversal(BinaryTree t){
	if (t != null) // {} missing
	return t.getRoot(); //return should be removed
	myPreOrderTraversal(this.getLeft()); //replace this with t
	myPreOrdertraversal(this.getRight()); //replace this with t
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.