Linked list vs. dynamic array for implementing a stack

后端 未结 5 1124
再見小時候
再見小時候 2020-12-24 13:02

I\'ve started reviewing data structures and algorithms before my final year of school starts to make sure I\'m on top of everything. One review problem said \"Implement a s

5条回答
  •  长情又很酷
    2020-12-24 13:57

    Well, for the small objects vs. large objects question, consider how much extra space to use for a linked list if you've got small objects on your stack. Then consider how much extra space you'll need if you've got a bunch of large objects on your stack.

    Next, consider the same questions, but with an implementation based on dynamic arrays.

提交回复
热议问题