Which of the following is an example of a dynamic data structure?

Study for the End of Year 8 Computer Science Test. Prepare with flashcards and multiple choice questions, each with hints and explanations. Get ready for your exam!

Multiple Choice

Which of the following is an example of a dynamic data structure?

Explanation:
Dynamic data structures can grow or shrink as the program runs. A List fits this idea because you can add or remove elements and the structure automatically adjusts its size to hold whatever number of items you store. This flexibility is what makes it dynamic. In contrast, an array has a fixed size chosen when it’s created, so it doesn’t automatically resize. A static hash table and a static array are also fixed in size and layout, meaning they don’t change capacity during execution. So the List is the example that best demonstrates a dynamic data structure.

Dynamic data structures can grow or shrink as the program runs. A List fits this idea because you can add or remove elements and the structure automatically adjusts its size to hold whatever number of items you store. This flexibility is what makes it dynamic.

In contrast, an array has a fixed size chosen when it’s created, so it doesn’t automatically resize. A static hash table and a static array are also fixed in size and layout, meaning they don’t change capacity during execution. So the List is the example that best demonstrates a dynamic data structure.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy