MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / leafNodes

Method leafNodes

TreeBoundaryTraversalBinaryTree.java:42–51  ·  view source on GitHub ↗
(Node node, ArrayList<Integer> list)

Source from the content-addressed store, hash-verified

40 }
41
42 void leafNodes(Node node, ArrayList<Integer> list)
43 {
44 if(node.left==null && node.right==null)
45 {
46 list.add(node.data);
47 return;
48 }
49 if(node.left!=null) leafNodes(node.left,list);
50 if(node.right!=null) leafNodes(node.right,list);
51 }
52}

Callers 1

printBoundaryMethod · 0.95

Calls 1

addMethod · 0.45

Tested by

no test coverage detected