-
Letter sequence
The following letter sequence was generated by using a postorder traversal of a complete binary tree T. d e b f g c h What is the root of this tree?
Select one:
h
d
None of the above
f
-
Data Structure to Maintain Photographs Database
Your job is to build a data structure to maintain a set of photographs. Your photograph database should allow you to insert and search for photographs, as well as to designate some of the photographs as favourites by marking them. In more detail, your data structure should support the following operations:
Insert(x, t, m): inserts photograph x that was taken at time t. If m = 1, then the... -
The byte abstract data type is the smallest abstract data type in the integer group and is declared by using the keyword byte.
Skill/Topic: Memory, Abstract Data Types, and AddressesA) TrueB) FalseExplanation: The byte abstract data type is the smallest abstract data type in the integer group and is declared by using the keyword byte. ‘byte abstract data type’ is commonly used when sending data to and receiving data from a file or across a network.
-
What is precision?
Skill/Topic: Memory, Abstract Data Types, and AddressesA) Precision refers the accuracy of the decimal portion of a value
-
Char *ptGrade;The use of the symbol ; ( semi colon) in the above example is wrong.
Skill/Topic: Variables and PointersA) TrueB) FalseExplanation: the symbol ; ( semi colon) tells the computer this is an instruction (statement)
-
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...
-
_________ 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 Structures Interview Questions
Ans