-
________ 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.
-
What is the most efficient way of finding a loop in linklist?
Traversing the link list with two pointers, both traversing at different speed.
-
The keyword ___________ means that the attribute or member method is accessible only by a member method.
Skill/Topic: Stacks using an ArrayA) PrivateB) PublicC) Both a) and b)D) Neither a) nor b)Explanation: The keyword private means that the attribute or member method is accessible only by a member method. The instance of the class cannot directly access a private member of the class.
-
Char *ptGrade;Which is the data type in this declaration?
Skill/Topic: Variables and PointersA) The data type in this is CharExplanation: The data type of the memory address stored in the pointer is of Character type
-
A _______ is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.
Skill/Topic: Queues Using Linked ListsA) queue linked listB) stacks linked listC) both of themD) neither of themExplanation: A queue linked list is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.
-
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
-
A tree can have a duplicate key.
Skill/Topic: TreeA) TrueB) False
-
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 doubly linked list is a linked list consisting of nodes that have both the previous and next elements.
Skill/Topic: Linked ListA) TrueB) False
-
How do you assign an address to an element of a pointer array ?
Skill/Topic: ArrayA) by using the address operator, which is the ampersand (&), in an assignment statementB) by using the address operator, which is the asterisks (*), in an assignment statementC) by using the address operator, which is the Double-asterisks (**), in an assignment statementD) None of the above Explanation: You assign a memory address to an element of a pointer array by using the address...
-
A Pointer is a Variable.
Skill/Topic: Variables and PointersA) FalseB) TrueExplanation: A pointer is a variable and can be used as an element of a structure and as an attribute of a class in some programming languages such as C++, but not Java. However, the contents of a pointer is a memory address of another location of memory, which is usually the memory address of another variable, element of a structure, or attribute of...
-
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.
-
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
-
StackLinkedList class inherits the LinkedList class.
Skill/Topic: Stacks using Linked ListA) TrueB) False
-
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
-
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...
-
The LinkedList constructor is a member function that is called when an instance of the LinkedList is removed.
Skill/Topic: Linked ListA) TrueB) FalseExplanation: The LinkedList constructor is a member function that is called when an instance of the LinkedList is declared
-
The LinkedList class specification is defined in the source file.
Skill/Topic: Linked ListA) TrueB) FalseExplanation: The LinkedList class specification is defined in the header file, and the implementation is defined in the source file.
-
What member function places a new node at the end of the linked list?
Skill/Topic: Linked ListA) appendNode()B) addNode()C) displayNode()D) structNode()Explanation: The appendNode() member function places a new node at the end of the linked list. The appendNode() requires an integer representing the current data of the node.
-
A node can reference more than one data element.
Skill/Topic: Linked ListA) TrueB) FalseExplanation: Yes, a node can reference more than one data element if the current data element of the node is a pointer to a group of data such as an instance of a class, a structure, or an array.
Data Structures Interview Questions
Ans