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

Method main

java/Chapter 2/Question2_2/Question.java:78–90  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

76 }
77
78 public static void main(String[] args) {
79 LinkedListNode head = AssortedMethods.randomLinkedList(10, 0, 10);
80 System.out.println(head.printForward());
81 int nth = 3;
82 IntWrapper wr = new IntWrapper();
83 LinkedListNode n = nthToLastR3(head, nth);
84 nthToLastR1(head, nth);
85 if (n != null) {
86 System.out.println(nth + "th to last node is " + n.data);
87 } else {
88 System.out.println("Null. n is out of bounds.");
89 }
90 }
91
92}

Callers

nothing calls this directly

Calls 4

randomLinkedListMethod · 0.95
printForwardMethod · 0.95
nthToLastR3Method · 0.95
nthToLastR1Method · 0.95

Tested by

no test coverage detected