public int delete(int index){ if(index == 0){ return deleteFirst(); } if(index == size - 1){ return deleteLast(); } Node prev = get(index - 1); int val = prev.next.value; prev.next = prev.next.next; // mystack.push(val); return val; }
mystack.push(val);
delete
int val = mylist.delete(index); mystack.push(val);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)