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
In the following search function for a linked list using the Node and NodePtr as defined in the text), why is there code to check if here is NULL?
NodePtr searchNodePtr head, int target)
{
NodePtr here = head;
Ifhere == NULL)
{
Return NULL;
}
Else
{
While here->data != target && here->link != NULL)
{
Here = here->link;
}
Ifhere->data == target)
{
Return here;
}
Else
{
Return NULL;
}
}
}
(Multiple Choice)
4.9/5
(42)
Most applications that use a stack will store a struct or class object on the stack.
(True/False)
4.7/5
(44)
The last node in a linked list as defined in the text should always point back to the head of the list.
(True/False)
4.9/5
(23)
The stack can be compared to a line of people at a bank, where the first person in line is the first person served.
(True/False)
4.8/5
(30)
In a linked list as defined in the text, the pointer in the last node in the list should always point to _________.
(Short Answer)
4.8/5
(40)
The function used to put data into a stack is typically called _______.
(Short Answer)
4.8/5
(48)
The arrow operator ->) combines the actions of which two operators?
(Short Answer)
4.8/5
(35)
If you need to access the last element of a linked list with N nodes in it, how many comparisons do you need to make to find the last element?
(Multiple Choice)
4.9/5
(40)
A _________ is a struct or class object that has one or more member variables that are pointer variables.
(Short Answer)
4.8/5
(32)
What is wrong with the following definition of headInsert?
Struct Node
{
Int item;
Node* link;
};
Typedef Node* NodePtr;
Void headInsertNodePtr& head, int data)
{
NodePtr tmp = new Node;
Tmp->item = data;
Head->next = tmp;
Tmp->next = head->next;
}
NodePtr head;
HeadInserthead, 4);
(Multiple Choice)
4.8/5
(41)
If you need to insert an element in the front of a list with N nodes and move the other elements back one place), how many nodes do you have to move?
(Multiple Choice)
4.8/5
(34)
Showing 21 - 40 of 64
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)