coding_quiz3

coding_quiz3

University

11 Qs

quiz-placeholder

Similar activities

DSA(UNIT 1) Test 1

DSA(UNIT 1) Test 1

University

10 Qs

CCT1 Data Structure B.Sc.II

CCT1 Data Structure B.Sc.II

University

11 Qs

Data Structure II

Data Structure II

University

10 Qs

Stacks and Queues Quiz

Stacks and Queues Quiz

University

15 Qs

Data Structure

Data Structure

University

10 Qs

Data Structures Quiz-2

Data Structures Quiz-2

University

10 Qs

DSA - Intro

DSA - Intro

University

10 Qs

UAS AlStrukDat

UAS AlStrukDat

University

10 Qs

coding_quiz3

coding_quiz3

Assessment

Quiz

Computers

University

Hard

Created by

Ankur Aggarwal

Used 3+ times

FREE Resource

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Jaswinder has a book of tickets and wants to store ticket numbers in a data structure. New ticketsare added to the end of the booklet. Ticket at the top of the stack is issued to the customer. Which data structure should Jaswinder use to represent the ticket booklet?

Queue

Stack

Array

Graph

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Q is an empty queue. The following operations are done on it:

ADD 5

ADD 7

ADD 46

DELETE

ADD 13

DELETE

DELETE

ADD 10

What will be the content of Q after these operations. Front is marked by (F) and Rear is markedby (R).

10(R) 13(F)

5(R) 10(F)

13(R) 10(F)

10(R) 5(F)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A stack is implemented as a linear array A[0…N-1]. Noor writes the following functions for popping an element from the stack.

function POP( top, N ){

if( X ){

top = top - 1

}else{

print "Underflow"}

return top}

Fill in the condition X

top< N-1

top<n

top>1

top >= 0

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A stack is implemented as a linear array A[0…N-1]. Farhan writes the following functions for pushing an element E in to the stack.

function PUSH( top, E, N ){

if(X){

top= top+1A[top] = E

}else{

print "Overflow"}

return top}

Fill in the condition X

top< N

top <n-1

top > 0

top > 1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A is an empty stack. The following operations are done on it.

PUSH(1)

PUSH(2)

POP

PUSH(5)

PUSH(6)

POP

What will the stack contain after these operations. (Top of the stack is underlined)

5 6

1 5

2 5

2 6

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The array A has n elements. We want to determine the position of X in the array. We know that X is present in the array A and X can be present at any location in the array with equal probability. How many comparisons will be required on average to find the element X using linear search?

n

2*n

(n+1)/2

n^2

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Srishti writes a program to find an element in the array A[5] with the following elements in order: 8 30 40 45 70. She runs the program to find a number X. X is found in the first iteration of binary search. What is the value of X?

40

8

70

30

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?