Sei sulla pagina 1di 1

public Node search(int e1) {

Node temp;
for (temp = head; temp.next != null; temp = temp.next) {

if (temp.val == e1) {
break;
}

}
if (temp.val != e1) {
System.out.println(" not found");

}
else{
System.out.println(" value found"+" "+temp.val);
}

return temp;

Potrebbero piacerti anche