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

Method printBoundary

TreeBoundaryTraversalBinaryTree.java:3–11  ·  view source on GitHub ↗
(Node node)

Source from the content-addressed store, hash-verified

1class Solution
2{
3 ArrayList <Integer> printBoundary(Node node)
4 {
5 ArrayList<Integer> list = new ArrayList<>();
6 if(node.left!=null || node.right!=null) list.add(node.data);
7 leftBoundary(node,list);
8 leafNodes(node,list);
9 rightBoundary(node,list);
10 return list;
11 }
12
13 void leftBoundary(Node node, ArrayList<Integer> list)
14 {

Callers

nothing calls this directly

Calls 4

leftBoundaryMethod · 0.95
leafNodesMethod · 0.95
rightBoundaryMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected