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
10 questions
Web Object Identification

Quiz
•
University
10 questions
Notes on Blender 3D: Section 14

Quiz
•
6th Grade - University
10 questions
GODOT ENGINE

Quiz
•
University
9 questions
C++ linked lists

Quiz
•
University
9 questions
Data Structures and Algorithm

Quiz
•
University
10 questions
LINKED LIST

Quiz
•
University
10 questions
DS QUIZ-1

Quiz
•
University
10 questions
Computer

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University