
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
C - Pointers

Quiz
•
University
10 questions
Kuis 3 - ASD - A

Quiz
•
University
10 questions
Data Structures Quiz

Quiz
•
University
7 questions
1D Array

Quiz
•
University
13 questions
Graph Traversal Algorithms Quiz

Quiz
•
12th Grade - University
10 questions
Data Structure Recap PART1

Quiz
•
University
15 questions
AS Computing: Data Structures

Quiz
•
10th Grade - University
10 questions
Weekly Contest #3 - TechXNinjas

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University