- namespace MyCollections.Generic
- {
- public class ListNode<T>
- {
- private ListNode<T> next;
- private T data;
- public ListNode<T> Next
- {
- get => next;
- set => next = value;
- }
- public T Data
- {
- get => data;
- set => data = value;
- }
- public ListNode(T data)
- {
- this.data = data;
- next = null;
- }
- }
- }