
coding_quiz3
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Ankur Aggarwal
Used 7+ times
FREE Resource
Enhance your content in a minute
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
GIS Unit III
Quiz
•
University
15 questions
Computer and Other Human Inventions
Quiz
•
University
10 questions
Python with DataScience
Quiz
•
7th Grade - University
15 questions
Robotics Prelim
Quiz
•
University
10 questions
UTILITY PROGRAM
Quiz
•
University
10 questions
Data Warehouse - Foundations
Quiz
•
University
13 questions
Digital Technology Office 365 - 29May2020
Quiz
•
University - Professi...
7 questions
Data mining-Clustering-1
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
