Created
June 29, 2022 03:34
-
-
Save RakhmedovRS/47272129eea9dbc18b78f1591e79d3cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Append a node of value val to the last element of the linked list. | |
*/ | |
public void addAtTail(int val) | |
{ | |
Link link = new Link(val); | |
//<-- | |
tail.prev.next = link; | |
link.prev = tail.prev; | |
//--> | |
link.next = tail; | |
tail.prev = link; | |
size++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment