Exam 13: Pointers and Linked Lists
Exam 1: Introduction to Computer and C++ Programming56 Questions
Exam 2: C++ Basics57 Questions
Exam 3: More Flow of Control45 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value53 Questions
Exam 5: Functions for All Sub Tasks54 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes52 Questions
Exam 7: Arrays48 Questions
Exam 8: Strings and Vectors69 Questions
Exam 9: Pointers and Dynamic Arrays39 Questions
Exam 10: Defining Classes61 Questions
Exam 11: Friends, Overloaded Operators, and Arrays in Classes56 Questions
Exam 12: Separate Compilation and Namespaces41 Questions
Exam 13: Pointers and Linked Lists64 Questions
Exam 14: Recursion48 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates35 Questions
Exam 18: Standard Template Library59 Questions
Select questions type
Given the following declarations, which statement would allocate memory for the first item in the list?
Struct Node
{
Int item;
Node* link;
};
Typedef Node* NodePtr;
NodePtr head;
(Multiple Choice)
4.9/5
(35)
If you push the following numbers onto an integer stack, what item is on the top of the stack? 1,4,8,16)
(Multiple Choice)
4.9/5
(41)
Given the following function declaration
Void insert NodePtr afterMe, int num);
//PRE: afterMe points to some node in the non-empty list
//POST: A new node containing num is inserted after afterMe.
Void insertNodePtr afterMe, int num)
{
// which of the following function definitions correctly implement this //function?
}
(Multiple Choice)
4.8/5
(30)
Given the following stack declaration, which of the following function definitions would correctly push an item onto the stack?
Struct StackFrame
{
Char data;
StackFrame *link;
};
Typedef StackFrame* StackFramePtr;
Class Stack
{
Public:
Stack );
Stackconst Stack& a_stack);
~Stack );
Void pushchar the_symbol);
Char pop );
Bool empty ) const;
Private:
StackFramePtr top;
};
(Multiple Choice)
4.8/5
(38)
If you write a linked list class, then you should implement the destructor, copy constructor, and the assignment operator
(True/False)
4.8/5
(29)
If NodeTypePtr is defined to be a pointer type to a node in a linked list, then the declaration
NodeTypePtr head;
(Multiple Choice)
4.9/5
(35)
Which of the following loops correctly uses iter as an iterator to move through the nodes of the linked list?
NodePtr iter; //a pointer to a node
(Multiple Choice)
4.8/5
(39)
When adding a node to a linked list, which pointer variable do you update first?
(Short Answer)
4.8/5
(43)
Apart from constructors, the operations for a stack listed in the text are ____________, _____________, and _______________,
(Short Answer)
4.8/5
(37)
Given the following declarations, which statement would put the value of 3 in the item part of the first node in the linked list?
Struct Node
{
Int item;
Node* link;
};
Typedef Node* NodePtr;
NodePtr head;
Head = new Node;
(Multiple Choice)
4.7/5
(42)
The function used to get the data at the top or front) of the stack is called _______.
(Short Answer)
4.9/5
(38)
Apart from constructors, the operations for a queue listed in the text are ____________, _____________, and _______________,
(Short Answer)
4.8/5
(37)
When would you use a linked list over an array or a dynamic array?
(Multiple Choice)
4.8/5
(39)
Showing 41 - 60 of 64
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)