-
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...
-
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
-
What is the purpose of the isEmpty() member method?
Skill/Topic: Stacks using an ArrayA) The isEmpty() member method determines if a value is at the top of the stack and is called before an attempt is made to remove the value
-
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.
-
The ~Queue() member function is the Constructor ?
Skill/Topic: QueueA) TrueB) FalseExplanation: The ~Queue() member function is the destructor.It uses the delete operator to remove the array from memory when the instance of the Queue class goes out of scope.
-
What is the formula used to calculate the back of the queue?
Skill/Topic: QueueA) The back of the queue is calculated by using the following formula:back = (back+1) % size
-
How is the front of the queue calculated ?
Skill/Topic: QueueA) The front of the queue is calculated by front = (front+1) % size
-
The last member function is _____________.
Skill/Topic: Linked ListA) appendNode()B) destroyList()C) displayNode()D) structNode()Explanation: destroyList()is the last memeber function and is called to remove the instance of the LinkedList from memory.
-
Look at the following example LinkedList(){ front = NULL; back = NULL;}In this example, Both the front and back pointers are assigned a NULL value.
Skill/Topic: Linked ListA) TrueB) FalseExplanation: In this example of a the LinkedList constructor , Both the front and back pointers are assigned a NULL value.The purpose of the constructor in the linked list example is to initialize the front and back pointers as shown in the following definition. Both the front and back pointers are assigned a NULL value, which is used by the appendNode() member...
-
What is the use of displayNodesReverse() member function?
Skill/Topic: Linked ListA) 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
-
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
-
Astack is a data structure that organizes data similar to how you organize dishes in a stack on your kitchen counter.
Skill/Topic: Stacks using Linked ListA) TrueB) False
-
Why is the constructor of the StackLinkedList class empty?
Skill/Topic: Stacks using Linked ListA) The constructor of the StackLinkedList class is empty because the constructor of the LinkedList class is called when an instance of the StackLinkedList class is declared. The constructor of the LinkedList class initializes the node and attributes that are
-
Why is the destructor of the StackLinkedList class empty?
Skill/Topic: Stacks using Linked ListA) The destructor of the StackLinkedList class is empty because the destructor of the LinkedList class is called prior to the destructor of the StackLinkedList class. This is because the LinkedList class is inherited by the StackLinkedList class.
-
__________ file contains the actual stack application.
Skill/Topic: Stacks using Linked ListA) StackLinkedListDemo.cpp
-
The isEmpty () member function must determine if the stack is empty.
Skill/Topic: Stacks using Linked ListA) TrueB) FalseExplanation: The pop () member function must determine if the stack is empty
-
-
In an array queue, data is stored in an _____ element.
Skill/Topic: Queues Using Linked ListsA) NodeB) linked listC) arrayD) constructorExplanation: In an array queue, data is stored in an array element. In a linked list queue, data is stored in a node of a linked list
-
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.
-
Which node is removed from the queue when the dequeue() member method is called?
Skill/Topic: Queues Using Linked ListsA) The node at the front of the queue is removed when the dequeue() member method is called.
Data Structures Interview Questions
Ans