Data Structures

Data Structures

University

22 Qs

quiz-placeholder

Similar activities

business 1.4 revision

business 1.4 revision

KG - Professional Development

20 Qs

Google SketchUp Tool

Google SketchUp Tool

KG - University

20 Qs

Memory-Mobo-Hard/Software

Memory-Mobo-Hard/Software

University

18 Qs

Closing entries

Closing entries

University

20 Qs

PARC Linux Basic Part 2

PARC Linux Basic Part 2

University

20 Qs

SQL Quiz

SQL Quiz

University

18 Qs

switch case

switch case

University

17 Qs

CORLANG Week6-7

CORLANG Week6-7

10th Grade - University

20 Qs

Data Structures

Data Structures

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

M CSE

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

22 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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(); } } }

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers