本文整理汇总了C#中SinglyLinkedLists.SinglyLinkedList.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# SinglyLinkedList.Remove方法的具体用法?C# SinglyLinkedList.Remove怎么用?C# SinglyLinkedList.Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SinglyLinkedLists.SinglyLinkedList
的用法示例。
在下文中一共展示了SinglyLinkedList.Remove方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ListRemoveWithDuplicateNodes
public void ListRemoveWithDuplicateNodes()
{
SinglyLinkedList list = new SinglyLinkedList("foo", "bar", "grille", "bar");
list.Remove("bar");
var expected = new string[] { "foo", "grille", "bar" };
CollectionAssert.AreEqual(expected, list.ToArray());
}
示例2: CountChangesOnRemoval
public void CountChangesOnRemoval()
{
SinglyLinkedList list = new SinglyLinkedList("foo", "bar", "grille");
list.Remove("foo");
Assert.AreEqual(2, list.Count());
list.Remove("bar");
Assert.AreEqual(1, list.Count());
list.Remove("grille");
Assert.AreEqual(0, list.Count());
}
示例3: ListRemoveLastItemFromList
public void ListRemoveLastItemFromList()
{
SinglyLinkedList list = new SinglyLinkedList("foo", "bar", "grille");
list.Remove("grille");
var expected = new string[] { "foo", "bar" };
CollectionAssert.AreEqual(expected, list.ToArray());
}
示例4: ListRemoveNonExistentNode
public void ListRemoveNonExistentNode()
{
SinglyLinkedList list = new SinglyLinkedList("foo", "bar", "grille");
list.Remove("cat");
var expected = new string[] { "foo", "bar", "grille" };
CollectionAssert.AreEqual(expected, list.ToArray());
}
示例5: IndexOfRemovedElement
public void IndexOfRemovedElement()
{
SinglyLinkedList list = new SinglyLinkedList();
list.AddLast("foo");
list.AddLast("bar");
list.AddLast("grille");
list.Remove("foo");
Assert.AreEqual(-1, list.IndexOf("foo"));
}
示例6: ListRemoveItemFromMiddleOfList
public void ListRemoveItemFromMiddleOfList()
{
SinglyLinkedList<string> list = new SinglyLinkedList<string>("foo", "bar", "grille");
list.Remove("bar");
var expected = new string[] { "foo", "grille" };
CollectionAssert.AreEqual(expected, list.ToArray());
}
示例7: ListRemoveFirstNode
public void ListRemoveFirstNode()
{
SinglyLinkedList<string> list = new SinglyLinkedList<string>("foo", "bar", "grille");
list.Remove("foo");
var expected = new string[] { "bar", "grille" };
CollectionAssert.AreEqual(expected, list.ToArray());
}
示例8: ListRemoveFirstNode
public void ListRemoveFirstNode()
{
SinglyLinkedList list = new SinglyLinkedList("foo", "bar", "grille");
list.Remove("foo");
var expected = new string[] { "bar", "grille" };
//throw new ArgumentException(list.ToString());
CollectionAssert.AreEqual(expected, list.ToArray());
}