CSE334 - ETE - PracticeSet - Quizizz
CSE334 - ETE - PracticeSet - Quizizz
CSE334 - ETE - PracticeSet - Quizizz
Worksheets Name
CSE334_ETE_PracticeSet
Class
Total questions: 50
Worksheet time: 2hrs 54mins
Date
Instructor name: Mr. Pushpendra Pateriya
c) This solution violates progress requirement. d) This solution violates bounded wait
requirement.
2.
a) Mutual exclusion but not progress b) Progress but not mutual exclusion
c) Neither mutual exclusion nor progress d) Both mutual exclusion and progress
https://quizizz.com/print/quiz/66437054540ae33980f90e67 1/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
3.
a) 1 b) 4
c) 2 d) 3
a) 7 b) 9
c) 11 d) 8
5. If an array is unsorted, what is the best time complexity to find an element using any
algorithm?
c) O(log n) d) O(1)
6. Which sorting algorithm would you use if you need to maintain the relative order of equal
elements (i.e., stability) and also require the algorithm to be efficient in terms of time
complexity?
https://quizizz.com/print/quiz/66437054540ae33980f90e67 2/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
a) O(n) b) O(n^2)
c) O(n) d) O(log n)
10. The minimum complexity of sorting n character strings, each of length n, in chronological order can
be analyzed by considering comparison-based sorting algorithms
a) O(n^2) b) O(n)
https://quizizz.com/print/quiz/66437054540ae33980f90e67 3/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
a) Circular wait is a necessary condition for the b) In a system where each resource has more
formation of deadlock. than one instance, a cycle in its wait-for
graph
indicates the presence of a deadlock.
14. A system has 6 identical resources and N processes competing for them. Each process can
request at
most 2 resources. Which one of the following values of N could lead to a deadlock?
a) 1 b) 4
c) 2 d) 3
https://quizizz.com/print/quiz/66437054540ae33980f90e67 4/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
15. In the context of operating systems, which of the following statements is/are correct with respect to
paging?
a) Paging helps solve the issue of external b) Page size has no impact on internal
fragmentation fragmentation
c) Both virtual page number and page frame d) Access right information
number
a) 52 bytes b) 60 bytes
c) 48 bytes d) 56 bytes
a) SLR b) LALR
c) LL d) LR
https://quizizz.com/print/quiz/66437054540ae33980f90e67 5/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
20.
Consider the problem of reversing a singly linked list. To take an example, given the linked list
below.
Which one of the following statements is TRUE about the time complexity of algorithms that solve
the above problem in O(1) space?
a) The best algorithm for the problem takes b) The best algorithm for the problem takes
theta(n) time in the worst case. theta(n
log n) time in the worst case.
c) The best algorithm for the problem takes d) It is not possible to reverse a singly linked
theta(n^2) time in the worst case. list in O(1) space.
21. What is the worst case time complexity of inserting n elements into an empty linked list, if the linked
list
needs to be maintained in sorted order?
c) theta(n^2) d) theta(1)
22. Suppose a circular queue of capacity (n-1) elements is implemented with an array of n elements.
Assume
that the insertion and deletion operations 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
https://quizizz.com/print/quiz/66437054540ae33980f90e67 6/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
23. A circular queue has been implemented using a singly linked list where each node consists of a
value and a single pointer pointing to the next node. We maintain exactly two external pointers
FRONT and REAR pointing to the front node and the rear node of the queue, respectively. Which
of the following statements is/are CORRECT for such a circular queue, so that insertion and
deletion operations can be performed in O(1) time?
I. Next pointer of front node points to the rear node.
II. Next pointer of rear node points to the front node
a) I only b) II only
24. The postorder traversal of a binary tree is 8,9,6,7,4,5,2,3,1. The inorder traversal of the same
tree is 8,6,9,4,7,2,5,1,3. The height of a tree is the length of the longest path from the root to any
leaf.
The height of the binary tree above is ______
Ans.
26. Consider the following statements regarding the front-end and back-end of a compiler.
S1: The front-end includes phases that are independent of the target hardware.
S2: The back-end includes phases that are specific to the target hardware.
S3: The back-end includes phases that are specific to the programming language used in the
source
code.
Identify the CORRECT option.
c) S1, S2, and S3 are all TRUE d) Only S1 and S3 are TRUE
https://quizizz.com/print/quiz/66437054540ae33980f90e67 7/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
27. Match the following according to input from List-I to the compiler phase in the List-II that processes
it:
29. expr -> expr '+' term | expr '-' term | term
term -> term '*' factor | term '/' factor | factor
factor -> '-' factor | '(' expr ')' | NUMBER
According to given grammar which one is the highest precedence operator.
a) / b) binary -
c) unary - d) *
a) {R} b) {w}
c) {w,y} d) {w,$}
https://quizizz.com/print/quiz/66437054540ae33980f90e67 8/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
31.
For the grammar below, a partial LL(1) parsing table is also presented along with the grammar.
Entries
that need to be filled are indicated as E1, E2 and E3. ε is the empty string, $ indicates end of input,
and |
separates alternate right hand sides of productions.
S → aAbB | bAaB | ε
A→S
B→S
The FIRST and FOLLOW sets for the nonterminals A and B are
Ans.
https://quizizz.com/print/quiz/66437054540ae33980f90e67 9/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
c) Both + and * are right associative d) Both + and * are left associative
35.
The attributes of three arithmetic operators in some programming language are given below.
The value of the expression 2 – 5 + 1 – 7 * 3 in this language is ________.
Ans.
a) make parsing and semantic analysis simpler. b) improve error recovery and error reporting.
c) increase the chances of reusing the machine d) improve the register allocation.
independent
code optimizer in other compilers
https://quizizz.com/print/quiz/66437054540ae33980f90e67 10/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
37.
Consider the DFA A given below. Which of the following are FALSE?
1. Complement of L(A) is context-free.
2. L(A) = L((11*0 + 0) (0 + 1)*0*1*)
3. For the language accepted by A, A is the minimal DFA
4. A accepts all strings over {0, 1} of length at least 2.
38.
The above DFA accepts the set of all strings over {0,1} that
39.
What is the complement of the language accepted by the NFA shown below?
Assume Σ = {a} and ε is the empty string.
a) ϕ b) {ε}
c) a* d) {a, ε}
https://quizizz.com/print/quiz/66437054540ae33980f90e67 11/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
a) The grammar is unambiguous and generates b) The grammar is ambiguous and can
unique parse trees for each valid expression. generate multiple parse trees for some
expressions.
c) The grammar does not generate expressions d) The grammar cannot generate expressions
with addition and multiplication. with parentheses.
a) E only b) T only
42.
Which of the regular expressions given below represent the following DFA?
I. 0* 1(1 + 00* 1)*
II. 0* 1* 1 + 11* 0* 1
III. (0 + 1)* 1
https://quizizz.com/print/quiz/66437054540ae33980f90e67 12/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
43.
44.
c) Strings that begin and end with the same d) All even length palindromes
symbol
https://quizizz.com/print/quiz/66437054540ae33980f90e67 13/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
47.
a) There is a unique minimal DFA for every b) Every NFA can be converted to an equivalent
regular language. PDA.
a) Deterministic finite automata (DFA) and b) Deterministic push down automata (DPDA)
Nondeterministic and
finite automata (NFA) Non-deterministic push down automata
(NPDA)
c) Deterministic single-tape Turing machine and d) Single-tape Turing machine and multi-tape
Non-deterministic single – tape Turing Turing machine
machine
a) Every NFA can be converted to an equivalent b) Every non-deterministic Turing machine can
DFA. be
converted to an equivalent deterministic
Turing
machine.
c) Every regular language is also a context-free d) Every subset of a recursively enumerable set
language. is
recursive.
https://quizizz.com/print/quiz/66437054540ae33980f90e67 14/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
Answer Keys
10. d) O(n^2 logn) 11. Merge Sort - O(nlogn), 12. Fibonacci Series -
F(n)=F(n−1)+F(n−2),
Quick Sort - O(n^2),
Towers of Hanoi -
Insertion Sort - O(n^2), T(n)=2T(n−1)+1,
25. (P) Tower of Hanoi with n 26. b) Only S1 and S2 are 27. P: Lexical analysis -
disks. TRUE
(iii) Regular expressions,
- theta(2^n),
(Q) Binary search given n Q: Top down parsing -
sorted numbers
- theta(log n), (i) Leftmost derivation,
(R) Heap sort given n
R: Semantic analysis -
numbers at the worst
https://quizizz.com/print/quiz/66437054540ae33980f90e67 15/16
5/14/24, 11:19 PM CSE334_ETE_PracticeSet | Quizizz
40. b) The grammar is 41. c) Both E and T 42. b) I and III only
ambiguous and can
generate multiple parse
trees for some
expressions.
https://quizizz.com/print/quiz/66437054540ae33980f90e67 16/16