Linked List vs Vector

后端 未结 5 585
轻奢々
轻奢々 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 19:03

    I know it's a bit late for this questioner but this is a very insightful video from Bjarne Stroustrup (the inventor of C++) about why you should avoid linked lists with modern hardware. https://www.youtube.com/watch?v=YQs6IC-vgmo With the fast memory allocation on computers today, it is much quicker to create a copy of the vector with the items updated.

提交回复
热议问题