-
_________ is the way you groups things together by placing one thing on top of another and then removing things one at a time from the top.
Skill/Topic: Stacks using an ArrayA) ArrayB) StackC) PointerD) All of the above
-
The isEmpty() member method determines if there is room for one more value on the stack.
Skill/Topic: Stacks using an ArrayA) TrueB) FalseExplanation: The isFull() member method determines if there is room for one more value on the stack.
-
What kind of value is assigned to the top attribute?
Skill/Topic: Stacks using an ArrayA) VariableB) IndexC) CharacterD) FloatExplanation: The value at the top attribute is an index.
-
Constructor is a member method of a class that is called when an instance of the class is declared.
Skill/Topic: Stacks using an ArrayA) TrueB) FalseExplanation: A constructor is a member method of a class that is called when an instance of the class is declared. A destructor is a member method of a class that is called when the instance of the class falls out of scope.
-
Data in a queue is accessible.
Skill/Topic: QueueA) First in First outB) First in last outC) Last in First outExplanation: Data in a queue is accessible in a First in First out (FIFO) Concept
-
Priority queue organizes items in a line where the first item is at the beginning of the line and the last item is at the back of the line.
Skill/Topic: QueueA) TrueB) FalseExplanation: A simple queue organizes items in a line where the first item is at the beginning of the line and the last item is at the back of the line. Each item is processed in the order in which it appears in the queue. The first item in line is processed first, followed by the second item and then the third until the last item on the line is processed.
-
Items on a priority queue can jump to the front of the line if they have priority.
Skill/Topic: QueueA) TrueB) FalseExplanation: A priority queue is similar to a simple queue in that items are organized in a line and processed sequentially. However, items on a priority queue can jump to the front of the line if they have priority. Priority is a value that is associated with each item placed in the queue.
-
The _______ process places data at the back of the queue.
Skill/Topic: QueueA) enqueueB) dequeueC) priority queue
-
Why is the isEmpty() member method called?
Skill/Topic: QueueA) The isEmpty() member method is called within the dequeue process to determine if there is an item in the queue to be removed.
-
A Node has ___ elements.
Skill/Topic: Linked ListA) NoneB) OneC) TwoD) ThreeExplanation: A node has three elements. These are the current data and pointers to the previous node and the next node on the linked list
-
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.
-
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.
-
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.
-
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
-
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
Data Structures Interview Questions
Ans