Interface LinkedListArray<T>


  • public interface LinkedListArray<T>
    Convert a LinkedList to a LinkedListNode array. LinkedListCreate provides an efficient implementation.
    Author:
    mrk
    • Method Detail

      • setNodes

        void setNodes​(LinkedList<T> linkedList)
        Set the LinkNode array from linkedList. If the current capacity of the array is less than the number of elements in the current array a new array is allocated. The values returned by getNodes and getLength are determined by the argument passed to setNodes. The linkedList is traversed by getHead and getNext.
        Parameters:
        linkedList - the list
      • getNodes

        LinkedListNode<T>[] getNodes()
        The LinkedListNode array as set by the last call to setNodes.
        Returns:
        the LinkedListNode array. The first getLength() elements are not null and the remaining elements are all null.
      • getLength

        int getLength()
        The number of non-null elements in the array returned by getNodes.
        Returns:
        the length
      • clear

        void clear()
        Clear the array. The array is set to null.