Example #1
0
    def test_get_kth_from_front(self, datas, k, expected):
        ll = LinkedList()
        ll.bulk_push_back(datas)

        actual = ll.get_kth_from_front(k)
        assert actual == expected
Example #2
0
    def test_remove_duplicate(self, datas, expected):
        l1 = LinkedList()
        l1.bulk_push_back(datas)
        l1.remove_duplicate()
        assert repr(l1) == expected

        l2 = LinkedList()
        l2.bulk_push_back(datas)
        l2.remove_duplicate_space_optimize()
        assert repr(l2) == expected