def to_a
      current = @first
      array = []
      while !current.nil?
        array << current.data
        current = current.next
      end
      array
    end
def to_a
      current = @first
      array = []
      while !current.nil?
        array << current.data
        current = current.next
      end
      array
    end
def to_a current = @first array = [ ] while ! current . nil? array << current . data current = current . next end array end
Returns an array containing the data from the nodes in the list
Returns an array containing the data from the nodes in the list