MCPcopy Create free account
hub / github.com/careercup/ctci / leftMostChild

Method leftMostChild

java/Chapter 4/Question4_6/Question.java:25–33  ·  view source on GitHub ↗
(TreeNode n)

Source from the content-addressed store, hash-verified

23 }
24
25 public static TreeNode leftMostChild(TreeNode n) {
26 if (n == null) {
27 return null;
28 }
29 while (n.left != null) {
30 n = n.left;
31 }
32 return n;
33 }
34
35 public static void main(String[] args) {
36 int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

Callers 1

inorderSuccMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected