Data Structures Flashcards

1
Q

What is the difference between an array and a linked list?

A

An array is a static data structure, while a linked list is a dynamic data structure. Arrays have a fixed size, and elements are stored consecutively in memory, while linked lists can grow and do not require contiguous memory allocation.

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

What are the advantage of Linked Lists?

A

Dynamic memory allocation

Efficient insertion and deletion

Can represent complex data structures

Can be used to implement queues and stacks

Can be used for memory management and caching

Can be used for garbage collection

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