KLU- CLUSTER -4 DAY-6
Quiz
•
English
•
Professional Development
•
Practice Problem
•
Hard
CCC info@ccc.training
Used 3+ times
FREE Resource
Enhance your content in a minute
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
following is C like pseudo-code of a function that takes a Queue as an argument, and uses a stack S to do processing. void fun(Queue *Q) { Stack S; // Say it creates an empty stack S while (!isEmpty(Q)) { push(&S, deQueue(Q)); } while (!isEmpty(&S)) { enQueue(Q, pop(&S)); } } What does the above function do in general?
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following pseudo code. Assume that IntQueue is an integer queue. What does the function fun do? void fun(int n) { IntQueue q = new IntQueue(); q.enqueue(0); q.enqueue(1); for (int i = 0; i < n; i++) { int a = q.dequeue(); int b = q.dequeue(); q.enqueue(b); q.enqueue(a + b); print(a); } }
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Let the following circular queue can accommodate maximum six elements with the following data.What will happen after ADD O operation takes place? front = 2 rear = 4 queue = _______; L, M, N, ___, ___
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter. MultiDequeue(Q){ m = k while (Q is not empty and m > 0) { Dequeue(Q) m = m - 1 } } What is the worst case time complexity of a sequence of n MultiDequeue() operations on an initially empty queue?
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
An implementation of a queue Q, using two stacks S1 and S2, is given below: void insert(Q, x) { push (S1, x); } void delete(Q){ if(stack-empty(S2)) then if(stack-empty(S1)) then { print(“Q is empty”); return; } else while (!(stack-empty(S1))){ x=pop(S1); push(S2,x); } x=pop(S2); } Let n insert and m (<=n) delete operations be performed in an arbitrary order on an empty queue Q. Let x and y be the number of push and pop operations performed respectively in the process. Which one of the following is true for all m and n?
Create a free account and access millions of resources
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
28 questions
B2 + C2 Vocabulary
Quiz
•
University - Professi...
25 questions
Moni's Review
Quiz
•
Professional Development
27 questions
Passages 1 - Unit 4 Quiz -C18
Quiz
•
Professional Development
26 questions
Dummy Quiz
Quiz
•
Professional Development
26 questions
Comprobacion de Lectura, servicio al cliente, sexto bimestre
Quiz
•
Professional Development
26 questions
NorthStar 3 - Unit #8 - Progress Check #9
Quiz
•
Professional Development
25 questions
Unit 2 - Home furnishings (basic) Macmillan 2023
Quiz
•
Professional Development
25 questions
English Quizz
Quiz
•
Professional Development
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for English
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
25 questions
Christmas Movies
Quiz
•
Professional Development
20 questions
Christmas Trivia
Quiz
•
Professional Development
15 questions
Fun Holiday Trivia
Quiz
•
Professional Development
25 questions
Name That Tune - Christmas
Quiz
•
Professional Development
29 questions
Christmas Song Emoji Pictionary
Quiz
•
Professional Development
9 questions
Holiday Movie Trivia
Lesson
•
Professional Development
34 questions
Winter Trivia
Quiz
•
Professional Development
