MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / inOrder

Method inOrder

Programs/BinaryTreeInorder.java:5–13  ·  view source on GitHub ↗
(Node root)

Source from the content-addressed store, hash-verified

3class Solution {
4 // Function to return a list containing the inorder traversal of the tree.
5 ArrayList<Integer> inOrder(Node root) {
6
7 //New ArrayList to return
8 ArrayList<Integer> li = new ArrayList<Integer>();
9
10 travel(root, li);
11
12 return li;
13 }
14
15 public static void travel(Node root, ArrayList<Integer> ans)
16 {

Callers 1

mainMethod · 0.95

Calls 1

travelMethod · 0.95

Tested by

no test coverage detected