Posted: 7 years ago Updated: 7 years ago 0 0 Edit public Link deleteLast(){ /* If the list is empty, function returns null */ if(first == null) return null; else{ Link current = first; Link previous = null; while(current.next! = null){ previous = current; current = current.next; } /* If the list has one element, update 'first' */ if(previous == null) first = null; else previous.next = null; } return current; }