(int key)
| 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); |
nothing calls this directly
no outgoing calls
no test coverage detected