SLR 14/ Data Structures Flashcards
1
Q
Advantage and Disadvantage of an Array
A
Advantage: Allows for random access, meaning any single element can be accessed via a single command.
Disadvantage: Static data structure. It can’t easily grow, as all items have to be stored contiguously in memory.
2
Q
Advantage and Disadvantage of Linked Lists
A
Advantage: Dynamic data structure. It can easily grow and shrink, as its data items are not held contiguously in memory.
Disadvantage: Can be slow to search, as it does not allow random access to the elements in the list. Searching for or deleting an item requires starting at the beginning and following every pointer until the required value is located.