예제 #1
0
 def test_linkedlist1(self):
     _list = LinkedListElements()
     self.assertTrue(_list.is_empty())
     _list.add(1)
     self.assertEqual(1, _list.get_head())
     self.assertFalse(_list.is_empty())
     self.assertEqual(1, _list.remove())
예제 #2
0
 def test_linkedlist2(self):
     _list = LinkedListElements()
     self.assertTrue(_list.is_empty())
     _list.add(1)
     _list.add(2)
     _list.add(3)
     self.assertEqual(3, _list.get_head())
     self.assertEqual(3, _list.remove())
     self.assertEqual(2, _list.get_head())
예제 #3
0
 def __init__(self):
     self.list = LinkedListElements()