MCPcopy Index your code
hub / github.com/careercup/ctci / linkedListToInt

Method linkedListToInt

java/Chapter 2/Question2_5/QuestionA.java:32–38  ·  view source on GitHub ↗
(LinkedListNode node)

Source from the content-addressed store, hash-verified

30 }
31
32 public static int linkedListToInt(LinkedListNode node) {
33 int value = 0;
34 if (node.next != null) {
35 value = 10 * linkedListToInt(node.next);
36 }
37 return value + node.data;
38 }
39
40 public static void main(String[] args) {
41 LinkedListNode lA1 = new LinkedListNode(9, null, null);

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected