Search Header Logo

DSA Quiz 2 Set 1

Authored by Shubham (M21CS016)

Education

University

Used 10+ times

DSA Quiz 2 Set 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Consider the following sequence of operations on an empty stack.

push(54); push(52); pop(); push(55); push(70); s=pop(). Consider the following sequence of operations on an empty queue. enqueue(21); enqueue(24);dequeue(); enqueue(28); enqueue(32); q=dequeue(). The value of s + q is

86

68

24

94

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Two matrices M1 and M2 are to be stored in arrays A and B respectively. Each array can be stored either in row-major or column-major order in contiguous memory locations. The time complexity of an algorithm to compute M1 × M2 will be

best if A is in row-major, and B is in column-major order.

best if both are in row-major order.

independent of the storage scheme.

best if both are in column-major order

3.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Predict the output of the following C code.

int main(){

char c = 011;

printf("%d",c);

return 0;

}

11

10

9

None of the other.

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

In how many ways you can insert 1,2,3,4,5,6,7,8 in an empty binary search tree, such that the resulting tree has height 7? (height of the tree with a single node is 0.)

2

4

64

None of the other.

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

In a binary tree, the number of internal nodes of degree 1 is 5, and the number of internal nodes of degree 2 is 10. The number of leaf nodes in the binary tree is –

10

11

12

15

6.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the following best fits for forward and back buttons in web browsers?

Stack

Queue

Binary Search Tree

None of these

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

For a binary tree with breadth first and preorder traversals ’a, b, e, c, d, f, g, h’ and ‘a, b, c, d, e, f, h,g’ respectively, the postorder traversal would be:

c d b h f g e a

c b d a h f g e

c d b h a f e g

c d b h f g a e

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?