Linked List vs Vector

后端 未结 5 551
轻奢々
轻奢々 2020-12-04 18:32

Over the past few days I have been preparing for my very first phone interview for a software development job. In researching questions I have come up with this article.

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 18:45

    As a correction on the Big O time of insertion and deletion within a linked list, if you have a pointer that holds the position of the current element, and methods used to move it around the list, (like .moveToStart(), .moveToEnd(), .next() etc), you can remove and insert in constant time.

提交回复
热议问题