public void Delete_Between_01() { var hashq = new HashQueue <int>(); Assert.AreEqual(0, hashq.Count()); hashq.Enqueue(1); hashq.Enqueue(2); hashq.Enqueue(3); Assert.AreEqual(1, hashq.Peek()); Assert.AreEqual(3, hashq.PeekTail()); hashq.Delete(2); Assert.AreEqual(1, hashq.Peek()); Assert.AreEqual(3, hashq.PeekTail()); }
public void PeekPeekTail01() { var hashq = new HashQueue <int>(); hashq.Enqueue(1); hashq.Enqueue(2); hashq.Enqueue(3); Assert.AreEqual(1, hashq.Peek()); Assert.AreEqual(3, hashq.PeekTail()); }
public void Delete_HeadTail_02() { var hashq = new HashQueue <int>(); Assert.AreEqual(0, hashq.Count()); hashq.Enqueue(1); Assert.AreEqual(1, hashq.Peek()); Assert.AreEqual(1, hashq.PeekTail()); hashq.Delete(1); Assert.IsTrue(hashq.IsEmpty()); }