public void VisitBinaryTree(NODE node) { … }
public void VisitBinaryTree(NODE node) { if (node == null) return; … }
public void DoSomething(NODEnode) { … }
public void VisitBinaryTree(NODE node) { if (node == null) return; DoSomething(node); }
public void VisitBinaryTree(NODE node) { if (node == null) return; DoSomething(node); VisitBinaryTree(node.LeftSon); VisitBinaryTree(node.RightSon); }
public void VisitBinaryTree(NODE node) { DoSomething(node); if (node.LeftSon != null) VisitBinaryTree(node.LeftSon); if (node. RightSon != null) VisitBinaryTree(node.RightSon); }
public void OneMethod(…) { … VisitBinaryTree(null); … }
public void VisitBinaryTree(NODE node) { if (node == null) return; DoSomething(node); if (node.LeftSon != null) VisitBinaryTree(node.LeftSon); if (node. RightSon != null) VisitBinaryTree(node.RightSon); }
public void VisitBinaryTree(NODE node) { if (node == null) return; DoSomething(node); VisitBinaryTree(node.RightSon); }
public void VisitBinaryTree(NODE node) { if (node == null) return; VisitBinaryTree(node.LeftSon); DoSomething(node); }
public void VisitBinaryTree(NODE node) { if (node == null) return; VisitBinaryTree(node.LeftSon); DoSomething(node); VisitBinaryTree(node.RightSon); }