Linked List (Module 3.3) Flashcards
What is a dynamic linear data structure where each element (node) contain data and a pointer?
linked list
What is a user-defined data type that holds data and pointer?
node
Do linked lists store elements in memory locations?
No!
What is the key to dynamic growth of a linked list?
the pointer to the next (and previous) nodes
A pointer may be set to ______, indicating the end of a linked list
null
A linked list uses ___________ memory spaces
non-continuous
Which type of linked list has each node point to the next node, but can’t go backwards?
singly linked list
Which type of linked list has two pointers for each node that point to next and previous node?
doubly linked list
What is a limitation of the doubly linked list?
It requires more memory for each additional pointer
Which linked list has the last node point to the first node, creating a loop?
circular linked list
Can a circular list be singly or doubly linked?
Yes!
What is the limitation of the circular linked list?
traversal need more logic to detect cycles
What are the two special pointers in linked list?
head and tail
Which special pointer points to the first node in the linked list?
head
Is the head or tail a node itself?
No!
The linked list is empty, where do the head or tail point to?
null
The head and tail can be considered a ________ to the start and end of a linked list
reference
How would you create a node?
Node head = new Node(10);
How would you point a second node to the third node?
second.next = third;
What are the advantages of a linked list?
dynamic size, efficient insertion/deletion, memory efficiency
What are the disadvantages of a linked list?
random access, memory overhead, complexity