本文整理匯總了C#中SinglyLinkedLists.SinglyLinkedList.Last方法的典型用法代碼示例。如果您正苦於以下問題:C# SinglyLinkedList.Last方法的具體用法?C# SinglyLinkedList.Last怎麽用?C# SinglyLinkedList.Last使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SinglyLinkedLists.SinglyLinkedList
的用法示例。
在下文中一共展示了SinglyLinkedList.Last方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: LastOnShortList
public void LastOnShortList()
{
SinglyLinkedList list = new SinglyLinkedList();
list.AddLast("foo");
Assert.AreEqual("foo", list.Last());
}
示例2: LastOnLongerList
public void LastOnLongerList()
{
SinglyLinkedList list = new SinglyLinkedList();
list.AddLast("foo");
list.AddLast("bar");
list.AddLast("grille");
Assert.AreEqual("grille", list.Last());
}
示例3: LastOnEmptyList
public void LastOnEmptyList()
{
SinglyLinkedList list = new SinglyLinkedList();
Assert.AreEqual(null, list.Last());
}
示例4: SortThenGetLast
public void SortThenGetLast()
{
SinglyLinkedList<string> list = new SinglyLinkedList<string>("foo", "bar", "grille", "zoo", "cat");
list.Sort();
Assert.AreEqual("zoo", list.Last());
}
示例5: TestingMyLastMethodWithNoNodes
public void TestingMyLastMethodWithNoNodes()
{
SinglyLinkedList list = new SinglyLinkedList();
Assert.AreEqual(null, list.Last());
}
示例6: TestingMyLastMethodWithNodes
public void TestingMyLastMethodWithNodes()
{
SinglyLinkedList list = new SinglyLinkedList();
SinglyLinkedListNode node1 = new SinglyLinkedListNode("foo");
list.AddLast("foo");
Assert.AreEqual("foo", list.Last());
}