Node search(int key){ Node temp = head; while(temp != null){ if(temp.key == key){ return temp; } temp = temp.next; } return null; }