VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/c-sharp-get-the-last-node-of-the-linkedlistt/

⇱ C# | Get the last node of the LinkedList<T> - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

C# | Get the last node of the LinkedList<T>

Last Updated : 11 Jul, 2025
LinkedList<T>.Last property is used to get the last node of the LinkedList<T>. Syntax:
public System.Collections.Generic.LinkedListNode Last { get; }
Return Value: The last LinkedListNode<T> of the LinkedList<T>. Below given are some examples to understand the implementation in a better way: Example 1: Output:
E
Example 2:
Output:
LinkedList is empty
Note:
  • LinkedList accepts null as a valid Value for reference types and allows duplicate values.
  • If the LinkedList is empty, the First and Last properties contain null.
  • Retrieving the value of this property is an O(1) operation.
Reference:
Comment

Explore