Linked List slides Flashcards

1
Q

What are the three types of linked lists?

A

Singly Linked Lists: Nodes contain data and a reference to the next node.
Doubly Linked Lists: Nodes contain data and two references: one to the
next node and one to the previous node.
Circular Linked Lists: The last node points back to the first node, creating
a circular loop.

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

What are the basic operations on linked lists?

A

Insertion: Add new nodes to the start, middle, or end of the list.
Deletion: Remove nodes from any position based on criteria.
Traversal: Sequentially access each node to read or modify data.
Searching: Locate nodes containing specific values through sequential
scanning.

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

What are the advantages of linked lists?

A

Dynamic sizing: Grow or shrink during execution without wasting memory
Efficient operations:Insertions and deletions are more efficient compared to
arrays, especially at the beginning or within the list.
No Memory Waste: Memory is allocated only as needed, in contrast to the
upfront allocation of arrays.
Ease of Implementation: Supports the implementation of stacks, queues,
and other complex data structures.

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

What are the disadvantages of linked lists?

A

Memory Overhead: Each node requires extra memory for pointers,
increasing the overall memory usage compared to simple arrays.
No Random Access: Direct access to an element (like in arrays) is not
possible; one must traverse from the start (or end) to reach a specific node,
which can be time-consuming.
Complex Implementations: Implementing and maintaining linked lists can be
more complex and prone to errors, especially for beginners, due to the need
to manage pointers and ensure the integrity of links between nodes.

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

What are the real world applications of Linked list?

A

Memory Management: Linked lists are used in dynamic memory allocation
to efficiently manage available memory spaces.
Data Structure Implementation: Stacks and queues are often implemented
using linked lists due to their dynamic nature and efficient insertion/deletion
operations.
Navigation Systems: In applications like image viewers or music players,
linked lists facilitate the seamless navigation between items (e.g.,
next/previous image or track).

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

What are the Key points of Linked Lists?

A

Linked lists offer dynamic size adjustment, efficient insertions/deletions, and
are essential for certain algorithms and data structures.
They come with drawbacks like memory overhead, lack of random access,
and potentially complex implementation.

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