func (ll *LinkedList[T]) Clear() {
	if ll.length == 0 {
		return
	}
	items := make([]Node[T], 0, ll.length)
	for n := ll.First(); n != nil; n = n.Next() {
		if n != nil {
			items = append(items, n)
		}
	}
	for _, item := range items {
		if item != nil {
			n := item.(*node[T])
			if n != nil {
				n.parent = nil
				n.prev = nil
				n.next = nil
			}
		}
	}
	ll.length = 0
	ll.head = nil
	ll.tail = nil
}
// Clear removes all items from the list.
Clear removes all items from the list.
// Clear removes all items from the list .
func (ll *LinkedList[T]) Clear() {
	if ll.length == 0 {
		return
	}
	items := make([]Node[T], 0, ll.length)
	for n := ll.First(); n != nil; n = n.Next() {
		if n != nil {
			items = append(items, n)
		}
	}
	for _, item := range items {
		if item != nil {
			n := item.(*node[T])
			if n != nil {
				n.parent = nil
				n.prev = nil
				n.next = nil
			}
		}
	}
	ll.length = 0
	ll.head = nil
	ll.tail = nil
}
func ( ll * LinkedList [ T ] ) Clear ( ) { if ll . length == 0 { return } items := make ( [ ] Node [ T ] , 0 , ll . length ) for n := ll . First ( ) ; n != nil ; n = n . Next ( ) { if n != nil { items = append ( items , n ) } } for _ , item := range items { if item != nil { n := item . ( * node [ T ] ) if n != nil { n . parent = nil n . prev = nil n . next = nil } } } ll . length = 0 ll . head = nil ll . tail = nil }
Clear removes all items from the list.
Clear removes all items from the list .