Times for common operations:
add remove
Beginning O(n) O(n)
End O(1) O(1)
Middle O(n) O(n)
单链表形式如上图所示,内部包含“key”和“next pointer”指针,且指向一个方向。
Time complexity:
Times for common operations:
add remove
Beginning O(n) O(n)
End O(1) O(1)
Middle O(n) O(n)
单链表形式如上图所示,内部包含“key”和“next pointer”指针,且指向一个方向。
Time complexity: