Quiz 2 Practice

Quiz
•
Computers
•
University
•
Easy
Remo Mahmoud
Used 6+ times
FREE Resource
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
One advantage of a doubly linked list over a singly linked list is that insertion and deletion is more efficient.
True
False
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A subclass can access the private members of its superclass.
True
False
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A class template cannot have more than one typename.
True
False
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code fragment?
13
7
Infinite loop
17
5.
OPEN ENDED QUESTION
3 mins • 1 pt
Write down the function addFront in class CircleList which takes one argument: An element “e” of type int, passed by reference.
The function creates a new node and puts element “e” in it, and then inserts the newly-created node at the front of the circularly linked list.
Evaluate responses using AI:
OFF
Answer explanation
void CircleList::addFront(int& e) {
CNode* v = new CNode; // create a new node
v−>elem = e;
// handling the special case when the list is empty
if (cursor == NULL){
v−>next = v; // v points to itself
cursor = v;
}
// if the list is not empty
else {
v−>next = cursor−>next;
cursor−>next = v;
}
}
Similar Resources on Wayground
5 questions
Data Structure

Quiz
•
University
10 questions
Stack

Quiz
•
University
10 questions
Struktur Data

Quiz
•
University
8 questions
FOS Ch.1 PArt 4 (QUIZ 4)

Quiz
•
University
10 questions
Quiz despre B+ Tree

Quiz
•
University
9 questions
Data structures

Quiz
•
University
10 questions
Lecture 02

Quiz
•
University
10 questions
GCSE Computer Science 9-1: Sorting Algorithms

Quiz
•
10th Grade - University
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade