Times for common operations:

                     add       remove

Beginning     O(n)      O(n)

End               O(1)      O(1)

Middle          O(n)       O(n)






 


      Single Linked List--Data StructureSingle Linked List--Data Structure

单链表形式如上图所示,内部包含“key”和“next pointer”指针,且指向一个方向。




Time complexity:

Single Linked List--Data Structure

Single Linked List--Data Structure

相关文章: