Data Structures Quiz

Data Structures Quiz

University

22 Qs

quiz-placeholder

Similar activities

Basics of Data Structure

Basics of Data Structure

University

20 Qs

DS GRAND QUIZ

DS GRAND QUIZ

University

20 Qs

Stack & Quiz

Stack & Quiz

University

20 Qs

Fundamentals of Data Structures-Test 1-Unit-1

Fundamentals of Data Structures-Test 1-Unit-1

University

20 Qs

Stack and Queue

Stack and Queue

University

25 Qs

Data Structures using C

Data Structures using C

12th Grade - University

20 Qs

DSA Quiz 2

DSA Quiz 2

University

18 Qs

Data Structure

Data Structure

University

20 Qs

Data Structures Quiz

Data Structures Quiz

Assessment

Quiz

Computers

University

Hard

Created by

M CSE

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?