What is the functionality of the following piece of code? public void display() { if(size == 0) System.out.println("underflow"); else { Node current = first; while(current != null) { System.out.println(current.getEle()); current = current.getNext(); } } }

Data Structures Quiz

Quiz
•
Computers
•
University
•
Hard
M CSE
FREE Resource
22 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
display the list
reverse the list
reverse the list excluding top-of-the-stack-element
display the list excluding top-of-the-stack-element
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following doubly linked list: head-1-2-3-4-5-tail. What will be the list after performing the given sequence of operations? Node temp = new Node(6,head,head.getNext()); Node temp1 = new Node(0,tail.getPrev(),tail); head.setNext(temp); temp.getNext().setPrev(temp); tail.setPrev(temp1); temp1.getPrev().setNext(temp1);
head-0-1-2-3-4-5-6-tail
head-1-2-3-4-5-6-tail
head-6-1-2-3-4-5-0-tail
head-0-1-2-3-4-5-tail
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is false about a doubly linked list?
We can navigate in both the directions
It requires more space than a singly linked list
The insertion and deletion of a node take a bit longer
Implementing a doubly linked list is easier than singly linked list
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed?
ABCD
DCBA
DCAB
ABDC
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A normal queue, if implemented using an array of size MAX_SIZE, gets full when?
Rear = MAX_SIZE – 1
Front = (rear + 1)mod MAX_SIZE
Front = rear + 1
Rear = front
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following postfix expression? ab*cd*+ where a=2,b=2,c=3,d=4.
16
12
14
10
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the stack | 5 | | 4 | | 3 | | 2 |. At this point, ‘*’ is encountered. What has to be done?
5*4=20 is pushed into the stack
* is pushed into the stack
2*3=6 is pushed into the stack
* is ignored
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
data structures1

Quiz
•
University
20 questions
Data Structures

Quiz
•
University
20 questions
Quantitative Aptitude Series

Quiz
•
University
20 questions
Latihan Soal Struktur Data

Quiz
•
University
20 questions
UTS - Struktur Data

Quiz
•
University
25 questions
Data Strucuture & Python

Quiz
•
University
20 questions
java list quiz

Quiz
•
University
18 questions
Linked List

Quiz
•
KG - University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade