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

Method linkedListToInt

java/Chapter 2/Question2_5/QuestionB.java:63–70  ·  view source on GitHub ↗
(LinkedListNode node)

Source from the content-addressed store, hash-verified

61 }
62
63 public static int linkedListToInt(LinkedListNode node) {
64 int value = 0;
65 while (node != null) {
66 value = value * 10 + node.data;
67 node = node.next;
68 }
69 return value;
70 }
71
72 public static void main(String[] args) {
73 LinkedListNode lA1 = new LinkedListNode(3, null, null);

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected