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

Method insertBefore

java/Chapter 2/Question2_5/QuestionB.java:54–61  ·  view source on GitHub ↗
(LinkedListNode list, int data)

Source from the content-addressed store, hash-verified

52 }
53
54 private static LinkedListNode insertBefore(LinkedListNode list, int data) {
55 LinkedListNode node = new LinkedListNode(data, null, null);
56 if (list != null) {
57 list.prev = node;
58 node.next = list;
59 }
60 return node;
61 }
62
63 public static int linkedListToInt(LinkedListNode node) {
64 int value = 0;

Callers 2

addListsHelperMethod · 0.95
addListsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected