Quiz Q 1 What does the following program

  • Slides: 22
Download presentation
Quiz

Quiz

Q 1 -What does the following program print? �#include<stdio. h> void f(int *p, int

Q 1 -What does the following program print? �#include<stdio. h> void f(int *p, int *q) { p = q; *p = 2; } int i = 0, j = 1; int main() { f(&i, &j); printf("%d %d n", i, j); getchar(); return 0; }

 Q 2 -In the given below statement, what does the “pf” indicate? int

Q 2 -In the given below statement, what does the “pf” indicate? int (*pf)(); A-pf is a pointer of a function which return int B - pf is a pointer C - pf is a function pointer D - None of the above

Q 3 -The value of j at the end of the execution of the

Q 3 -The value of j at the end of the execution of the following C program. int incr (int i) { static int count = 0; count = count + i; return (count); } main () { int i, j; for (i = 0; i <=4; i++) j = incr(i); }

Q 4 - Which of the following is not a type of constructor? A.

Q 4 - Which of the following is not a type of constructor? A. Copy constructor B. Friend constructor C. Default constructor D. Parameterized constructor

 Q 5 -Complexity of Linear Search Algorithm? Q 6 -Operation of processing each

Q 5 -Complexity of Linear Search Algorithm? Q 6 -Operation of processing each element in list is knows as ? Q 7 - Give an Example of Linear and Non. Linear Data structure.

Q 8 -Linked list are not suitable data structure of which one of the

Q 8 -Linked list are not suitable data structure of which one of the following problems ? [A] Insertion sort [B] Binary search [C] Radix sort [D] Polynomial manipulation

Q 9 -What is the time complexity of Build Heap operation. Build Heap is

Q 9 -What is the time complexity of Build Heap operation. Build Heap is used to build a max(or min) binary heap from a given array. Build Heap is used in Heap Sort as a first step for sorting. �A. O(n. Logn) �B. O(n^2) �C. O(Logn) �D. O(n)

Q 10 -Merge sort uses ? �[A] Divide and conquer strategy �[B] Backtracking approach

Q 10 -Merge sort uses ? �[A] Divide and conquer strategy �[B] Backtracking approach �[C] Heuristic search �[D] Greedy approach

Q 11 -A line connecting the points (1, 1) and (5, 3) is to

Q 11 -A line connecting the points (1, 1) and (5, 3) is to be drawn, using DDA algorithm. Find the value of x and y increments �[A] x-increments = 1; y-increments =1 �[B] x-increments = 0. 5; y-increments =1 �[C] x-increments = 1; y-increments =0. 5 �[D] None of above

Q 12. The relation { (1, 2), (1, 3), (3, 1), (1, 1), (3,

Q 12. The relation { (1, 2), (1, 3), (3, 1), (1, 1), (3, 3), (3, 2), (1, 4), (4, 2), (3, 4)} is A. Reflexive B. Transitive C. Symmetric D. Asymmetric

Q 13 -The number of leaf nodes in a complete binary tree of depth

Q 13 -The number of leaf nodes in a complete binary tree of depth d is A. 2^d B. 2^(d– 1)+1 C. 2^(d+1)+1 D. 2^(d+1)

Q 14 -A partial ordered relation is transitive, reflexive and A. Antisymmetric �B. Bisymmetric

Q 14 -A partial ordered relation is transitive, reflexive and A. Antisymmetric �B. Bisymmetric �C. Anti reflexive. �D. Asymmetric

Q 15 -The maximum degree of any vertex in a simple graph with n

Q 15 -The maximum degree of any vertex in a simple graph with n vertices is A. n– 1 �B. n+1 �C. 2 n– 1 �D. n

Q 16 - Reduce the boolean expression ABC + A'B'C + A'BC + ABC'

Q 16 - Reduce the boolean expression ABC + A'B'C + A'BC + ABC' + A'B'C' to five literals. �[A] A'B' + B(A+C) �[B] AB + A'(C+C') �[C] A'B' + A(B+C) �[D] A'B + B'(A+C')

Q 17 -For the given boolean function, F(w, x, y, z) = wx +

Q 17 -For the given boolean function, F(w, x, y, z) = wx + yz, what would be the value of (F+F')? �[A]. 0 �[B]. 1 �[C]. w(x+y') + w'y'z + wx'z' �[D]. x(wy+z) + y'(xz+w) + z'(y+x')

Q 18 -Express the boolean function F = xy + x'z in POS �[A].

Q 18 -Express the boolean function F = xy + x'z in POS �[A]. POS(0, 2, 4, 5) �[B]. POS(0, 2, 4, 6) �[C]. POS(0, 2, 5, 6) �[D]. POS(0, 4, 5, 6)

Q 19 -Determine the value of base x if 211 (base x) = 152

Q 19 -Determine the value of base x if 211 (base x) = 152 (base 8) �[A]. x=7 �[B]. x=5 �[C]. x=6 �[D]. None of these

Q 20 -Database table by name Loan_Records is given below. Borrower Bank_Manager Loan_Amount Ramesh

Q 20 -Database table by name Loan_Records is given below. Borrower Bank_Manager Loan_Amount Ramesh Sunderrajan 100000 Suresh Ramgopal 5000 Mahesh Sunderrajan 7000 What is the output of the following SQL query ? SELECT count(*) From (SELECT Borrower. Bank_Manager From Loan_Records) AS S Natural Join (SELECT BANK_manager, Loan_Amount From Loan_Records) As T ); �[A]. 5 �[B]. 6 �[C]. 9 �[D]. 3

Answers Ans 1 - 0 2 Ans 2 - A Ans 3 - 10

Answers Ans 1 - 0 2 Ans 2 - A Ans 3 - 10 Ans 4 - B Ans 5 -O(n) Ans 6 -Traversal Ans 7 -Array, Linked List/Graph/Tree. Ans 8 -(B). Binary search

Answers Ans 9 - o(n). Ans 10 – (A). Divide and conquer strategy Ans

Answers Ans 9 - o(n). Ans 10 – (A). Divide and conquer strategy Ans 11 -. x-increments = 1; y-increments =0. 5 Ans 12 - (B) Transitive. Ans 13 - (A) 2 d Ans 14 - (A) Antisymmetric. Ans 15 - (A) n-1 Ans 16 – (A) A'B' + B(A+C)

Answers Ans 17 – (B) 1 Ans 18 – (A) POS(0, 2, 4, 5)

Answers Ans 17 – (B) 1 Ans 18 – (A) POS(0, 2, 4, 5) Ans 19 -. (A) x=7 Ans 20 – (A) 5