using System;
using System.Text;
using System.Collections.Generic;
public class Example
{
public static void Main()
{
// Create the link list.
string[] words ={ "the", "fox", "jumped", "over", "the", "dog" };
LinkedList sentence = new LinkedList(words);
Display(sentence, "The linked list values:");
LinkedListNode mark1 = sentence.Last;
sentence.RemoveLast();
sentence.AddFirst(mark1);
Display(sentence, "Test 4: Move last node to be first node:");
}
private static void Display(LinkedList words, string test)
{
Console.WriteLine(test);
foreach (string word in words)
{
Console.Write(word + " ");
}
}
}