Пример #1
0
 def test_search_forward(self):
     lst = OrderedList()
     self.assertFalse(lst.search_forward(10))
     lst.head = Node(2, Node(5, Node(10, None)))
     lst.tail = Node(10)
     lst.num_items = 3
     self.assertTrue(lst.search_forward(10))
Пример #2
0
 def test_search_backward(self):
     lst = OrderedList()
     self.assertFalse(lst.search_backward(10))
     lst.tail = Node(10, None, Node(5, None, Node(3)))
     lst.num_items = 3
     self.assertTrue(lst.search_backward(5))