SLR 14/ Data Structures Flashcards

You may prefer our related Brainscape-certified 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly