
coding_quiz3

Quiz
•
Computers
•
University
•
Hard
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
Similar Resources on Wayground
10 questions
Prob. prog 2

Quiz
•
University
15 questions
ROTC Make-up Quiz

Quiz
•
University
15 questions
Stack

Quiz
•
University
9 questions
Data Structures and Algorithm

Quiz
•
University
14 questions
A-Level Computer Science Data Structures Quiz

Quiz
•
12th Grade - University
15 questions
Microprogrammed Control Unit and Computer Architecture Quiz

Quiz
•
University
15 questions
[Python For All] Quiz 5 - Numpy

Quiz
•
University
12 questions
Quiz-1(Div-C)

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University