Fundamental Data Structures Flashcards

1
Q

What are the three fundamental linear data structures?

A

Lists, Stacks, and Queues.

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

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

A

Arrays have fixed size and contiguous memory allocation, while linked lists have dynamic size with non-contiguous memory allocation.

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

What are the operations on a linked list?

A

Insert, Delete, Search, Traverse.

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

What is a stack?

A

A LIFO (Last In, First Out) data structure with operations push, pop, and peek.

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

What is a queue?

A

A FIFO (First In, First Out) data structure with enqueue and dequeue operations.

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

What is a priority queue?

A

A queue where elements are dequeued based on priority rather than order of arrival.

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

What is a deque (double-ended queue)?

A

A queue where insertions and deletions can occur at both ends.

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

What are the advantages of linked lists over arrays?

A

Dynamic size, efficient insertions/deletions, no need for contiguous memory.

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

What is the downside of using a linked list?

A

Higher memory usage (extra pointers), slower random access (O(n) lookup).

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

What is an application of a Stack?

A

Function calls in recursion (call stack), undo feature in text editors.

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

What is an application of a Queue?

A

Task scheduling (CPU process scheduling, print queue).

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