
Singly and Doubly Linked List Quiz

Quiz
•
Other
•
University
•
Hard

Niveditha N
Used 1+ times
FREE Resource
17 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which line correctly defines a Node in a singly linked list?
class Node {
int data;
Node next;
Node(int d) {
_______________; // ← Fill this}}
this.next = d;
data = d; next = null;
this.data = next;
data = next;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What should go in the blank?
void insertAtHead(int data) {
Node newNode = new Node(data);
newNode.next = ___________; // ← Fill this
head = newNode;}
null
head
newNode
head.next
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
(Double)Which is correct?class DNode {
int data;
DNode next, prev;
DNode(int d) {
data = d;
next = null;
_________; // ← Fill }}
prev = d;
prev = null;
d = prev;
prev = next;
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which line completes the logic?(Double)
DNode newNode = new DNode(data);
newNode.next = head;
if (head != null)
head.__________ = newNode;
head = newNode;
next
prev
data
pointer
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Complete the code to print the list in reverse:(double)
DNode temp = tail;
while (temp != null) {
System.out.print(temp.data + " ");
temp = ___________;
}
temp.next
temp.prev
head.prev
temp.back
Create a free account and access millions of resources
Similar Resources on Wayground
16 questions
Data Structures Prelimes

Quiz
•
University
21 questions
Circular Linked List Quiz

Quiz
•
University
15 questions
BCA C Lab Component

Quiz
•
University
15 questions
Heart part 2 (EKG)

Quiz
•
University
14 questions
In-Lab5

Quiz
•
University
12 questions
JoJo Siwa 2021

Quiz
•
KG - Professional Dev...
18 questions
EKG dasar gangguan impuls

Quiz
•
University
20 questions
Riddle

Quiz
•
1st Grade - University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade