本文整理汇总了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());
}