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

Method nthToLastR3

java/Chapter 2/Question2_2/Question.java:44–50  ·  view source on GitHub ↗
(LinkedListNode head, int k)

Source from the content-addressed store, hash-verified

42 }
43
44 public static LinkedListNode nthToLastR3(LinkedListNode head, int k) {
45 Result res = nthToLastR3Helper(head, k);
46 if (res != null) {
47 return res.node;
48 }
49 return null;
50 }
51
52 public static LinkedListNode nthToLast(LinkedListNode head, int n) {
53 LinkedListNode p1 = head;

Callers 1

mainMethod · 0.95

Calls 1

nthToLastR3HelperMethod · 0.95

Tested by

no test coverage detected