MCPcopy Create free account
hub / github.com/apna-college/Alpha / searchHelper

Method searchHelper

12_LinkedList.java/LL.java:123–136  ·  view source on GitHub ↗
(Node head, int key)

Source from the content-addressed store, hash-verified

121 }
122
123 public int searchHelper(Node head, int key) {
124 if(head == null) {
125 return -1;
126 }
127 if(head.data == key) {
128 return 0;
129 }
130
131 int idx = searchHelper(head.next, key);
132 if(idx == -1) {
133 return idx;
134 }
135 return idx+1;
136 }
137
138 public void reverse() {
139 Node prev = null;

Callers 1

recSearchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected