click below
click below
Normal Size Small Size show me how
CP2-Module 6
Linked Lists: Operations of a Linked List and Building a Linked List
| Question | Answer |
|---|---|
| The operation used to create a linked list node Insertion Traversing Creation Deletion | Creation |
| Means to visit every element or node in the list beginning from first to last Create Traversal Insert Deletion | Traversal |
| The last node of a linked list is called ____________. Pointer Null Head Tail | Tail |
| What is the operation is used to insert a new node at any specified location in the linked list? Insertion Traversing Deletion Creation | Insertion |
| The first node of a linked list is called ____________. Null Head Tail Pointer | Head |
| It holds the addresses of the neighboring nodes or of those nodes which are associated with the given node as dictated by the application Data Item Link Head Array | Link |
| It holds the information content or data to be represented by the node. Data Item Head Array Link | Data Item |
| A node contains: Data Item and Address Address Identifier Data | Data Item and Address |
| It is the process of appending the second list to the end of the first list. Concatenation Deletion Insertion Traversing | Concatenation |
| Lists that has a dynamic size in memory Linked List Pointer Node Array | Linked List |
| It is the process of combining one list to another list. Traverse Concatenation Link Copy | Concatenation |
| An operation which adds a node in the list Insertion Display Creation Search | Insertion |
| #include <iostream> using namespace std; struct Node { int data; Node *next; }; int main() { Node *p; p = new Node; p -> data = 70; p -> next = NULL; cout << "Data " << p->data << endl ; return 0; } Output is? | Data 70 |
| Which of the following is true about the linked list? Elements are at contiguous location It has fixed size Random access is allowed It is dynamic | It is dynamic |
| Which of the following is the data part of the node? struct Node { int d; Node *n; }; Group of answer choices n struct d Node | d |
| Which of the following is not a variation of a linked list? Doubly Linked list Circular Linked list Diamond Linked list Singly Linked list | Diamond Linked list |
| What is the basic component of a linked list? Identifier Node Constant Argument | Node |
| Ending node of a linked list is also known as Link Head Pointer Tails | Tails |
| Nodes in a linked list can be deleted Specific location Beginning of the list End of the list All are statement are possible | All are statement are possible |
| Starting node of a linked list is also known as: Head Tails Pointer Link | Head |
| A linked list is a linear dynamic data structure to store data items. True or False? | True |
| Unlike arrays, linked lists store data items in contiguous memory locations. True or False? | False, linked lists DO NOT store data items in contiguous memory locations. |
| A linked list consists of items called “Nodes” which contain two parts: | Actual Data and Pointer to Next Node |
| Linked list size is dynamic. True or False? | True |
| Insertion/deletion is easier on Linked List. True or False? | True |
| Random access is not possible on Linked List. True or False? | True |
| Elements of a linked list have contiguous location. True or False? | False, elements have non-contiguous location on memory. |
| Like arrays, no extra memory space is required for next pointer in a Linked List. True or False? | False, linked lists require extra memory space for the next pointer. |
| What are the three types of linked lists? | Singly, Doubly, and Circular. |
| It is the most common. Each node has data and a pointer to the next node. | Singly Linked List |
| Using this type of Linked List we can go in either direction: forward or backward. | Doubly Linked List |
| We add a pointer to the previous node in a _____ linked list. | Doubly |
| A ______ linked list is a variation of a linked list in which the last element is linked to the first element. | Circular |
| What is enqueue? | Addition of an item to the queue is always done at the rear/tail of the queue. |
| What is dequeue? | Removes an item from the queue. An item is removed or dequeued always from the front/head of the queue. |
| What is pop in front? | Removing of an item in the head of a queue. |
| What is pop in back? | Removing of an item on the tail of a queue. |