C# LinkedList LinkedList(IEnumerable)
Description
LinkedList
initializes
a new instance of the LinkedList
Syntax
public LinkedList(
IEnumerable<T> collection
)
Parameters
collection
- The IEnumerable whose elements are copied to the new LinkedList.
Example
using System;// w w w. ja va2 s. c o m
using System.Collections.Generic;
public class MainClass{
public static void Main(String[] argv){
// Create the link list.
string[] words =
{ "the", "fox", "jumped", "over", "the", "dog" };
LinkedList<string> sentence = new LinkedList<string>(words);
}
}