1
what is the differernce between if (a=0) and if (a= -7) or any other non-zero number e.g what will be the out put of following program a)if ( a=0) printf(""a is zero ") else printf("a is not zero") and if we replace 0 by some +ve or -ve number then
2
Consider the following grammar: stmt $\rightarrow$ if expr then expr else expr; stmt | $0$ expr $\rightarrow$ term relop term | term term $\rightarrow$ id | number id $\rightarrow$ a | b | c number $\rightarrow [0-9]$ where relop is a relational operator (e.g.. $<$ ... example. the program if $e_1$ then $e_2$ else $e_3$ has $2$ control flow paths. $e_1 \rightarrow e_2$ and $e_1 \rightarrow e_3$.
3
"The hold of the nationalist imagination on our colonial past is such that anything inadequately or improperly nationalist is just not history." Which of the following statements best reflects the author's opinion? Nationalists are highly imaginative. History is viewed through the filter of nationalism. Our colonial past never happened. Nationalism has to be both adequately and properly imagined.
4
Let $T$ be a binary search tree with $15$ nodes. The minimum and maximum possible heights of $T$ are: Note: The height of a tree with a single node is $0$. $4$ and $15$ respectively. $3$ and $14$ respectively. $4$ and $14$ respectively. $3$ and $15$ respectively.
5
Six people are seated around a circular table. There are at least two men and two women. There are at least three right-handed persons. Every woman has a left-handed person to her immediate right. None of the women are right-handed. The number of women at the table is $2$ $3$ $4$ Cannot be determined
6
Find the smallest number $y$ such that $y \times 162$ is a perfect cube. $24$ $27$ $32$ $36$
7
Research in the workplace reveals that people work for many reasons _______________ . money beside beside money money besides besides money
8
Consider the C code fragment given below. typedef struct node { int data; node* next; } node; void join(node* m, node* n) { node* p = n; while(p->next != NULL) { p = p->next; } p->next = m; } Assuming that m and n point to valid NULL-terminated linked ... or append list m to the end of list n. cause a null pointer dereference for all inputs. append list n to the end of list m for all inputs.
9
Consider the following functions from positive integers to real numbers: $10$, $\sqrt{n}$, $n$, $\log_{2}n$, $\frac{100}{n}$. The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is: $\log_{2}n$, $\frac{100}{n}$, $10$, $\sqrt{n}$, $n$ $\frac{100}{n}$, $10$ ... $\frac{100}{n}$, $\sqrt{n}$, $\log_{2}n$, $n$ $\frac{100}{n}$, $\log_{2}n$, $10$, $\sqrt{n}$, $n$
10
Consider the first-order logic sentence $F:\forall x(\exists yR(x,y))$. Assuming non-empty logical domains, which of the sentences below are implied by $F$? $\exists y(\exists xR(x,y))$ $\exists y(\forall xR(x,y))$ $\forall y(\exists xR(x,y))$ $¬\exists x(\forall y¬R(x,y))$ IV only I and IV only II only II and III only
11
Consider the Karnaugh map given below, where $X$ represents "don't care" and blank represents $0$. Assume for all inputs $\left ( a,b,c,d \right )$, the respective complements $\left ( \bar{a}, \bar{b}, \bar{c}, \bar{d} \right )$ are also available. The above logic is implemented using $2$-input $\text{NOR}$ gates only. The minimum number of gates required is ____________ .
12
The n-bit fixed-point representation of an unsigned real number $X$ uses $f$ bits for the fraction part. Let $i = n-f$. The range of decimal values for $X$ in this representation is $2^{-f}$ to $2^{i}$ $2^{-f}$ to $\left ( 2^{i} - 2^{-f} \right )$ 0 to $2^{i}$ 0 to $\left ( 2^{i} - 2^{-f} \right )$
13
If the characteristic polynomial of a 3 $\times$ 3 matrix $M$ over $\mathbb{R}$ (the set of real numbers) is $\lambda^3 – 4 \lambda^2 + a \lambda +30, \quad a \in \mathbb{R}$, and one eigenvalue of $M$ is 2, then the largest among the absolute values of the eigenvalues of $M$ is _______
14
Let $\delta$ denote the transition function and $\widehat{\delta}$ denote the extended transition function of the $\epsilon$-NFA whose transition table is given below: $\begin{array}{|c|c|c|c|}\hline \delta & \text{$\epsilon$} & \text{$a$} & \text{$ ... $\widehat{\delta}(q_2, aba)$ is $\emptyset$ $\{q_0, q_1, q_3\}$ $\{q_0, q_1, q_2\}$ $\{q_0, q_2, q_3 \}$
15
The n-bit fixed-point representation of an unsigned real number $X$ uses $f$ bits for the fraction part. Let $i = n-f$. The range of decimal values for $X$ in this representation is $2^{-f}$ to $2^{i}$ $2^{-f}$ to $\left ( 2^{i} - 2^{-f} \right )$ 0 to $2^{i}$ 0 to $\left ( 2^{i} - 2^{-f} \right )$
16
After Rajendra Chola returned from his voyage to Indonesia, he ________ to visit the temple in Thanjavur. was wishing is wishing wished had wished
17
Let $T$ be a binary search tree with $15$ nodes. The minimum and maximum possible heights of $T$ are: Note: The height of a tree with a single node is $0$. $4$ and $15$ respectively. $3$ and $14$ respectively. $4$ and $14$ respectively. $3$ and $15$ respectively.
18
Consider the following function implemented in C: void printxy(int x, int y) { int *ptr; x=0; ptr=&x; y=*ptr; *ptr=1; printf(“%d, %d”, x, y); } The output of invoking $printxy(1,1)$ is: $0, 0$ $0, 1$ $1, 0$ $1, 1$
19
1 vote
20
21
Consider the Karnaugh map given below, where $X$ represents "don't care" and blank represents $0$. Assume for all inputs $\left ( a,b,c,d \right )$, the respective complements $\left ( \bar{a}, \bar{b}, \bar{c}, \bar{d} \right )$ are also available. The above logic is implemented using $2$-input $\text{NOR}$ gates only. The minimum number of gates required is ____________ .
22
Match the algorithms with their time complexities: $\begin{array}{|l|l|}\hline \textbf{Algorithms} & \textbf{Time Complexity} \\\hline \text{P. Tower of Hanoi with$n$disks} & \text{i.$\Theta (n^2)$} \\\hline \text{Q. Binary Search given$ ... $P\rightarrow (iv) \quad Q \rightarrow(iii)\quad r \rightarrow(ii) \quad S\rightarrow(i)$
23
24
25
Consider the following functions from positive integers to real numbers: $10$, $\sqrt{n}$, $n$, $\log_{2}n$, $\frac{100}{n}$. The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is: $\log_{2}n$, $\frac{100}{n}$, $10$, $\sqrt{n}$, $n$ $\frac{100}{n}$, $10$ ... $\frac{100}{n}$, $\sqrt{n}$, $\log_{2}n$, $n$ $\frac{100}{n}$, $\log_{2}n$, $10$, $\sqrt{n}$, $n$
26
The Breadth First Search (BFS) algorithm has been implemented using the queue data structure. Which one of the following is a possible order of visiting the nodes in the graph below? $\text{MNOPQR}$ $\text{NQMPOR}$ $\text{QMNROP}$ $\text{POQNMR}$
Consider the following C program. #include<stdio.h> #include<string.h> void printlength(char *s, char *t) { unsigned int c=0; int len = ((strlen(s) - strlen(t)) > c) ? strlen(s) : strlen(t); printf("%d\n", len); } void main() { char *x = "abc"; ... that $strlen$ is defined in $string.h$ as returning a value of type $size\_t$, which is an unsigned int. The output of the program is __________ .
Match the algorithms with their time complexities: $\begin{array}{|l|l|}\hline \textbf{Algorithms} & \textbf{Time Complexity} \\\hline \text{P. Tower of Hanoi with$n$disks} & \text{i.$\Theta (n^2)$} \\\hline \text{Q. Binary Search given$ ... $P\rightarrow (iv) \quad Q \rightarrow(iii)\quad r \rightarrow(ii) \quad S\rightarrow(i)$