Match List - I with List - II.
| List - I (Recurrence Relations) | List - II (Complexity) |
| (A) $T(n)=2T(n/2)+n$ | (I) $T(n)=\theta(n\log n)$ [exact solution] |
| (B) $T(n)=T(n/2)+1$ | (II) $O(n^2)$ |
| (C) $T(n)=2T(n/2)+1$ | (III) $T(n)=\theta(n)$ [exact solution] |
| (D) $T(n)=T(n-1)+1$ | (IV) $O(\log n)$ |
Choose the correct answer from the options given below :
(A) $T(n)=2T(n/2)+n$
Master theorem
$a=2,; b=2,; f(n)=n$
$\Rightarrow T(n)=\theta(n\log n)$
So (A) → (I)
(B) $T(n)=T(n/2)+1$
Divide size halves each step
$\Rightarrow T(n)=O(\log n)$
So (B) → (IV)
(C) $T(n)=2T(n/2)+1$
Master theorem
$\Rightarrow T(n)=\theta(n)$
So (C) → (III)
(D) $T(n)=T(n-1)+1$
Linear recurrence
$\Rightarrow T(n)=O(n)$
Closest option given:
(D) → (II)
Thus matching:
(A)-(I), (B)-(IV), (C)-(III), (D)-(II)
Function pointer syntax:
return_type (*pointer_name)(arguments);
Example:
int (*func)(int,int);
Meaning:
func is a pointer
pointing to a function
returning int
taking two int parameters
Thus correct declaration:
int (*func)(int,int);
Relational databases (MySQL, PostgreSQL, Oracle etc.) store data in relations (tables).
Each table consists of:
Rows → tuples / records
Columns → attributes / fields
Thus relational model structure:
tables with rows and columns
Which of the following tasks could be attained using syntax trees in compiler design ?
(A) Type Checking
(B) Code Generation
(C) Code Optimization
(D) Error Handling
Choose the correct answer from the options given below :
Syntax trees (Abstract Syntax Tree – AST) are used in later compiler phases.
(A) Type Checking → Done using syntax tree ✔
(B) Code Generation → Uses syntax tree ✔
(C) Code Optimization → Uses syntax tree representation ✔
(D) Error Handling → Mainly done during lexical / syntax analysis ✘
Thus correct tasks:
(A), (B), (C)
Given a project with an estimated effort of 1500 person-hours and a team of 5 people, how many days will it take to complete the project, if each person works 8 hours a day ?
Total effort
$1500$ person-hours
Work per day by team:
$5 \times 8 = 40$ hours/day
Days required
$= \frac{1500}{40}$
$= 37.5$
Consider the following C code :
#include<stdio.h>
int temp = 0;
int fun(int x, int y)
{
int z;
temp++;
if (y == 3)
return (x*x*x);
else
{
z = fun(x, y/3);
return (z*z*z);
}
}
int main()
{
fun(4,81);
printf("%d", temp);
}
What will be the output of the above code ?
Recursive calls divide $y$ by $3$ each time.
Call sequence:
$fun(4,81)$
$fun(4,27)$
$fun(4,9)$
$fun(4,3)$
Total calls = 4
Each call increments temp.
So
$temp = 4$
Given:
$P$ : It is hot day
$q$ : Temperature is $48^\circ C$
Expression:
$\neg P \land \neg q$
Meaning:
$\neg P$ → It is not a hot day
$\neg q$ → Temperature is not $48^\circ C$
Combined with AND:
Neither $P$ nor $q$
Thus sentence:
"It is neither a hot day nor temperature is $48^\circ C$"
Statement:
“Joy is loved by everyone”
Meaning:
Every person $x$ loves Joy.
Mathematically:
$\forall x; L(x,;Joy)$
(A)
$R_1={(1,1),(1,2),(2,1),(2,2),(3,4),(4,1),(4,4)}$
(B)
$R_2={(1,1),(1,2),(2,1)}$
(C)
$R_3={(1,1),(1,2),(1,4),(2,1),(2,2),(3,3),(4,1),(4,4)}$
(D)
$R_4={(2,1),(3,1),(3,2),(4,1),(4,2),(4,3)}$
(E)
$R_5={(1,1),(1,2),(1,3),(1,4),(2,2),(2,3),(2,4),(3,3),(3,4),(4,4)}$
Choose the correct answer from the options given below :
For a relation on ${1,2,3,4}$ to be reflexive, it must contain
$(1,1),(2,2),(3,3),(4,4)$
Check each:
$R_1$ → missing $(3,3)$ ✘
$R_2$ → missing $(3,3),(4,4)$ ✘
$R_3$ → contains $(1,1),(2,2),(3,3),(4,4)$ ✔
$R_4$ → missing all diagonal pairs ✘
$R_5$ → contains all $(1,1),(2,2),(3,3),(4,4)$ ✔
Thus reflexive relations:
$R_3$ and $R_5$
Fifth normal form is concerned with :
Database normal forms:
1NF → atomic values
2NF → remove partial dependency
3NF → remove transitive dependency
BCNF → stronger FD rules
4NF → multivalued dependency
5NF → join dependency
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.