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

Method itSearch

12_LinkedList.java/LL.java:105–117  ·  view source on GitHub ↗
(int key)

Source from the content-addressed store, hash-verified

103
104 //Iterative
105 public int itSearch(int key) {
106 Node temp = head;
107 int i = 0;
108
109 while(temp != null) {
110 if(temp.data == key) {
111 return i;
112 }
113 temp = temp.next;
114 i++;
115 }
116 return -1;
117 }
118
119 public int recSearch(int key) {
120 return searchHelper(head, key);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected