Linked List – peek, peekFirst, and peekLast methods
In this post, we will discuss the peek(), peekFirst(), and peekLast() methods of the Java LinkedList class. These methods retrieve the element present at the start or the end of the linked list. public E peek() peek() method is introduced in Java 5. What does it do? It retrieves the linked list’s first node ( […]
Linked List – peek, peekFirst, and peekLast methods Read More »