removed unused return values

This commit is contained in:
Doru Kesriyeli 2018-10-07 17:20:32 -07:00 committed by GitHub
parent eb01780ae6
commit ae2029424b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,13 +60,12 @@ class DoublyLinkedList{
*
* @return The new head
*/
public Link deleteHead(){
public void deleteHead(){
Link temp = head;
head = head.next; // oldHead <--> 2ndElement(head)
head.previous = null; // oldHead --> 2ndElement(head) nothing pointing at old head so will be removed
if(head == null)
tail = null;
return temp;
}
/**
@ -74,11 +73,11 @@ class DoublyLinkedList{
*
* @return The new tail
*/
public Link deleteTail(){
public void deleteTail(){
Link temp = tail;
tail = tail.previous; // 2ndLast(tail) <--> oldTail --> null
tail.next = null; // 2ndLast(tail) --> null
return temp;
}
/**
@ -87,7 +86,7 @@ class DoublyLinkedList{
* @param x element to be deleted
* @return Link deleted
*/
public Link delete(int x){
public void delete(int x){
Link current = head;
while(current.value != x) //Find the position to delete
@ -103,7 +102,6 @@ class DoublyLinkedList{
current.previous.next = current.next; // 1 --> 3
current.next.previous = current.previous; // 1 <--> 3
}
return current;
}
/**