-
data; temp = temp->Next; }}?">
Identify the error in the following example of the use of a displayNodesReverse() member function void displayNodesReverse(){ cout
Skill/Topic: Linked ListA) Syntax of displayNodesReverse() is wrongB) Node*temp should be NULLC) Wrong use of paranthesisD) temp should be equal to temp->previous Explanation: The displayNodesReverse() member function displays the contents of a linked list in reverse order,beginning with the node at the back of the linked list and continuing until the first node is displayed.So Previous should be...
-
Definitions of member functions for the LinkedList class are contained in?
Skill/Topic: Linked ListA) LinkedList.h fileB) LinkedList.cpp fileC) LinkedList.txt fileD) LinkedListDemo.cpp file Explanation: Definitions of member functions for the LinkedList class are contained in the LinkedList.cpp file
-
________ is the maximum number of nodes that you can have on a stack-linked list.
Skill/Topic: Stacks using Linked ListA) ZeroB) Same as linked listC) Any NumbersExplanation: There can be a nearly unlimited number of nodes on a stack-linked list, restricted only by the amount of available memory in the computer.
-
The pop() member function determines if the stack is empty by calling the _____ member function.
Skill/Topic: Stacks using Linked ListA) removeback()B) isEmpty()C) removedfront()Explanation: The pop() member function must determine if the stack is empty, or it will attempt to remove a node that isn’t on the stack. The pop() member function determines if the stack is empty by calling the isEmpty() member function, which you must define as part of the StackLinkedList class.
-
StackLinkedList class inherits the LinkedList class.
Skill/Topic: Stacks using Linked ListA) TrueB) False
-
What is the benefit of using a queue linked list?
Skill/Topic: Queues Using Linked ListsA) A queue linked list can expand and shrink in size when an application runs, depending on the needs of the application
-
Node on a queue linked list have more than one data element.
Skill/Topic: Queues Using Linked ListsA) TrueB) False
-
Why is the constructor of the QueueLinkedList class empty?
Skill/Topic: Queues Using Linked ListsA) because initialization of data members of the LinkedList class is performed by the constructor of the LinkedList class.B) because initialization of data members of the LinkedList class is performed by the destructor of the LinkedList class.C) because initialization of data members of the QueueLinkedList class is performed by the constructor of the LinkedList...
-
119 Let’s say that you need to access a particular node on a linked list, but you don’t know the reference to the node or the position the node has on the linked list, although you do know the data is stored in the node. You can locate the node by calling the _____ function.
Skill/Topic: Stacks and Queues: Insert, Delete, Peek, FindA) insertNode()B) giveNode()C) findNode()D) cannot locate the node at all
-
What is the purpose of a left child node and a right child node?
Skill/Topic: TreeA) The left child node has a key that is less than the key of its parent node. The right child node has a key that is greater than the key of its parent node
-
A leaf node does not have any child nodes.
Skill/Topic: TreeA) TrueB) FalseExplanation: A leaf node is the last node on a branch and does not have any child nodes
-
A tree can have a duplicate key.
Skill/Topic: TreeA) TrueB) False
-
What is the total number of spanning trees ?
The total number of spanning trees that can be drawn using five labelled vertices is: A)125 B) 64 C)36 D)16
Data Structures Interview Questions
Ans