m2 Flashcards
How do you remove data from a singly linked list?
You can only remove the data in the middle of the list.
You can only remove the last data from the list.
You can only remove the first data from the list.
You can remove the first data, last data, or any data in the list by adjusting the pointers of the respective nodes.
You can remove the first data, last data, or any data in the list by adjusting the pointers of the respective nodes.
What are the operations used in linked list structures?
Traversing the list, inserting data, removing data, and retrieving data.
Sorting the list, merging lists, splitting the list, and reversing the list.
Adding elements to the list, updating elements in the list, and searching for elements in the list.
Finding the maximum element, finding the minimum element, and finding the length of the list.
Traversing the list, inserting data, removing data, and retrieving data.
How do you retrieve data from a singly linked list?
Sort the list and compare the data field of each node to the value being searched for.
Reverse the list and compare the data field of each node to the value being searched for.
Skip every other node and compare the data field of each node to the value being searched for.
Traverse the list and compare the data field of each node to the value being searched for.
Traverse the list and compare the data field of each node to the value being searched for.
How do you insert data into a singly linked list?
Always insert the new data in between the first and second nodes of the list.
Always insert the new data at the beginning of the list.
Always insert the new data at the end of the list.
If the list is empty, create the first node. Otherwise, find the right position to insert the new data (beginning, end, or in between nodes)`
If the list is empty, create the first node. Otherwise, find the right position to insert the new data (beginning, end, or in between nodes).
What are the disadvantages of using a circular linked list?
It requires more complex implementation of operations on linked list structures.
It has limited functionality compared to other linked list structures.
It occupies more memory than other linked list structures.
It has slower traversal compared to other linked list structures
It requires more complex implementation of operations on linked list structures.
How do you traverse a singly linked list?
Starting from the head, check if the next pointer is null. If not, move to the next node until the end of the list is reached.
Starting from a random position, check if the previous or next pointer is null. If not, move to the previous or next node depending on the condition.
Starting from the tail, check if the previous pointer is null. If not, move to the previous node until the start of the list is reached.
Starting from the middle, check if the previous or next pointer is null. If not, move to the previous or next node depending on the condition.
Starting from the head, check if the next pointer is null. If not, move to the next node until the end of the list is reached.
How do you traverse and retrieve data from a circular linked list?
Skip every other node and compare the data field of each node to the value being searched for.
Reverse the list and compare the data field of each node to the value being searched for.
Sort the list and compare the data field of each node to the value being searched for.
Perform similar operations as with a singly linked list, but ensure the termination condition for traversal considers the circular nature of the list.
Perform similar operations as with a singly linked list, but ensure the termination condition for traversal considers the circular nature of the list.
What makes a doubly linked list different from a singly linked list?
A doubly linked list has a circular structure.
A doubly linked list allows bidirectional traversal.
A doubly linked list has three fields: data, previous, and next pointer.
A doubly linked list contains a reference to both the previous and next elements in the list.
A doubly linked list contains a reference to both the previous and next elements in the list.
What is a singly linked list?
A data structure that consists of two fields: data and previous pointer.
A data structure that consists of a sequence of elements, each containing a reference to the previous element.
A data structure that consists of a sequence of elements, each containing a reference to the next element.
A data structure that contains a reference to both the previous and next elements.
A data structure that consists of a sequence of elements, each containing a reference to the next element.
What are the advantages of using a circular linked list?
It uses less memory than other linked list structures.
It provides easy manipulation of the pointers and efficient searching.
It allows for faster insertion and deletion operations compared to other linked list structures.
It guarantees constant time complexity for all operations.
It provides easy manipulation of the pointers and efficient searching.
What is the purpose of converting an infix expression to postfix notation using a stack?
To reverse the order of the operands and operators
To convert numbers from decimal to binary notation
To evaluate arithmetic expressions and handle operator precedence
To group the operands and operators in parentheses
To evaluate arithmetic expressions and handle operator precedence
What are some of the applications that can be solved using Stack data structure?
Expression Evaluation, Function Call Stack, Undo Operations, Backtracking, Memory Management
Sorting Algorithms, Binary Search, Linked Lists
Looping, Conditional Statements, File Handling
Networking, Database Management, Artificial Intelligence
Expression Evaluation, Function Call Stack, Undo Operations, Backtracking, Memory Management
Which operations can be used in the implementation of Stack data structure?
Append and Prepend
Push and Pop
Insert and Delete
Sort and Search
Push and Pop
In a Stack data structure, where are elements inserted and removed?
Middle of the stack
Random positions in the stack
Bottom of the stack
Top of the stack
Top of the stack
Which notation places the operator before the operands in an arithmetic expression?
Postfix notation
Polish notation
Infix notation
Prefix notation
Prefix notation
What is the principle behind Stack data structure?
Last-in-First-Out (LIFO)
Random
First-in-First-Out (FIFO)
Priority-based
Last-in-First-Out (LIFO)
What is the application of Stacks in memory management?
Managing activation records during program execution
Displaying graphics on computer screens
Storing data on hard disks
Accessing data from databases
Managing activation records during program execution
What is the term used for inserting elements into a stack?
Insert operation
Append operation
Push operation
Add operation
Push operation
Which data structure can be used to implement a Stack?
Arrays and Linked Lists
Queues and Graphs
Hash Tables and Trees
Sets and Matrices
Arrays and Linked Lists
What is the term used for deleting elements from a stack?
Remove operation
Extract operation
Pop operation
Delete operation
Pop operation
What is the function of the IsNull() operation in the Queue data structure?
Returns the size of the Queue
Evaluates if the queue is empty
Retrieves the element from the front of the Queue without removing it
Checks if the Queue is full or not
Evaluates if the queue is empty
Which operation is used to store elements in the Queue?
Size
Peek
Dequeue
Enqueue
Enqueue
Which operations can be used in the implementation of the Queue data structure?
Push and Pop
Enqueue and Dequeue
Sort and Search
Insert and Delete
Enqueue and Dequeue
What is the function of the Peek() operation in the Queue data structure?
Get the element from the front of the Queue without removing it
Enqueue the element into the Queue
Dequeue the element from the Queue
Returns the size of the Queue
Get the element from the front of the Queue without removing it
What is the function of the Size() operation in the Queue data structure?
Retrieves the element from the front of the Queue without removing it
Inserts the element into the Queue
Checks if the Queue is empty or not
Returns the size of the Queue
Returns the size of the Queue
What is the function of the IsFull() operation in the Queue data structure?
Checks if the Queue is full or not
Checks if the Queue is empty or not
Returns the size of the Queue
Retrieves the element from the front of the Queue without removing it
Checks if the Queue is full or not
Which operation is used to remove elements from the Queue?
Size
Enqueue
Peek
Dequeue
Dequeue
What is the principle behind the Queue data structure?
Random access
First In First Out (FIFO)
Last In First Out (LIFO)
Stack
First In First Out (FIFO)
What are some applications that can be solved using the Queue data structure?
Sorting and Searching
Job scheduling and Handling resource sharing
Hashing and String Matching
Graph Traversal and Shortest Path Finding
Job scheduling and Handling resource sharing
What are some of the variations of the Queue data structure?
Circular Queue and Priority Queue
Binary Tree and Heap
Graph and Hash Table
Stack and Linked List
Circular Queue and Priority Queue
What is a heap tree?
A binary tree with only leaf nodes
A binary tree with no nodes
A complete binary tree where the key at the root node is either the greatest (Max-Heap) or the smallest (Min-Heap) among all its children
A binary tree with only root nodes
A complete binary tree where the key at the root node is either the greatest (Max-Heap) or the smallest (Min-Heap) among all its children
What is the depth of a tree?
The highest level of the tree
The number of leaf nodes in the tree
The number of edges in the tree
The number of nodes in the tree
The highest level of the tree
What is a tree data structure?
A finite collection of data arranged in a hierarchical fashion
A linear collection of data arranged in a hierarchical fashion
A random collection of data arranged in a hierarchical fashion
An infinite collection of data arranged in a hierarchical fashion
A finite collection of data arranged in a hierarchical fashion
What is a subtree?
A tree with only leaf nodes
A tree with only root nodes
A complete tree within the main tree
A tree with no nodes
A complete tree within the main tree
What is the degree of a node?
The value of the node
The parent of the node
The level of the node
The number of child nodes
The number of child nodes
What is a leaf node?
A node with no child nodes
A node with a value of 0
A node with multiple child nodes
There is no such thing as a leaf node
A node with no child nodes