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

Method leftBoundary

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

Source from the content-addressed store, hash-verified

11 }
12
13 void leftBoundary(Node node, ArrayList<Integer> list)
14 {
15 node=node.left;
16 if(node==null) return;
17 while(node!=null)
18 {
19 if(node.left!=null || node.right!=null ) list.add(node.data);
20 if(node.left!=null) node=node.left;
21 else node=node.right;
22 }
23 }
24
25 void rightBoundary(Node node, ArrayList<Integer> list)
26 {

Callers 1

printBoundaryMethod · 0.95

Calls 1

addMethod · 0.45

Tested by

no test coverage detected