Semester : SEMESTER 6
Subject : Comprehensive Exam
Year : 2019
Term : MAY
Branch : COMPUTER SCIENCE AND ENGINEERING
Scheme : 2015 Full Time
Course Code : CS 352
Page:3
21.
22.
23.
24.
25.
26.
27
V1108 Pages: 6
forj=i+lton
print “Hi”
The asymptotic time complexity of above loop is
a) O(n’) 0) O(n log 7) ९) O(n’) d) Of)
Time complexity of inserting a new node at the middle of a single linked list is
a) O(log n) b) Od) €) O(n logn) d) O(n)
With only enqueue and dequeue operations, how many queues will you need to implement a
stack using queue?
a) 4 (b) 3 c) 2 (d) 1
A hash function f defined as f(key)= key mod 7, with linear probing used to resolve collisions.
Insert the keys 37,38,72,48,98 and 11 into the table indexed from 0 to 6. What will be the
location of 11?
a) 3 (b) 5 c) 4 (d) 6
The following sequence of operations are performed on a stack:
PUSH(10), PUSH(20), POP, PUSH(10), PUSH(20), POP, POP, POP, PUSH(20), POP
The sequence of values popped out is:
a) 20,10,20,10,20 (൫) 20,20,10,10,20 ९) 10,20,20,10,20 (9) 20,20,10,20,10
Consider the given grammar
S> AB
൧൭ BB/a
B> AB/b
Choose incorrect statement.
a) aaab can be (0) bbab can be (€) abba can be (6) abbab can be
derived from derived from derived from derived from
above grammar. above grammar. above grammar. above
grammar.
Let N be an NFA and w bea string. We say that N accepts w. if
a) Allcomputation (b) Exactly one ௦) Nocomputation (9) At least
paths of N on w computation path paths of N on w computation
reach an accept of N on w reaches reach an accept paths of N on w
state. an accept state. state. reach an accept
state.
Consider the following language, L= (യ ع {0, 1) | w is a palindrome |, Which of the
following grammar generates the above language?
a) ऽ -> 050 | 181 | (0) ऽ -> 0605116516 © ऽ -> 080 | 151| (൭ ऽ -> 080 | 151
€ | ع 011 011൦
Page 3 of 6