Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Implement a linked list

Implement a linked list data structure in Python.

It should support the following operations. Each operation should have a O(1) worst-case time complexity.

  • push_head should add an element to the start of the list. It should return something that can be passed to remove to remove that element in the future.
  • pop_tail should remove an element from the end of the list.
  • remove takes a handle from push_head, and removes that element from the list.

There are some tests in linked_list_test.py for your implementation - feel free to write more.