Aspire Faculty ID #18624 · Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II) · Just now
UGC NET Computer Science Dec 2022 Shift II (Paper II)

Let $n$ denote a positive integer. Suppose a function $F$ is defined as

$f(n)=
\begin{cases}
0, & n=1 \
f\left(\left\lfloor \frac{n}{2} \right\rfloor\right)+1, & n>1
\end{cases}$

What is $f(25)$? and what does this function find?

Solution

Given,

$f(1)=0$

Now find $f(25)$:

$f(25)=f\left(\left\lfloor \frac{25}{2} \right\rfloor\right)+1$

$f(25)=f(12)+1$

$f(12)=f(6)+1$

$f(6)=f(3)+1$

$f(3)=f(1)+1$

$f(1)=0$

Now putting values back:

$f(3)=0+1=1$

$f(6)=1+1=2$

$f(12)=2+1=3$

$f(25)=3+1=4$

So,

$f(25)=4$

This function counts how many times $n$ can be divided by $2$ until it becomes $1$.

So, it finds:

$\left\lfloor \log_2 n \right\rfloor$

Previous 10 Questions — UGC NET Computer Science Dec 2022 Shift II (Paper II)

Nearest first
1
How many different binary trees are possible with $n$ nodes?
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
2
For a function of two variables, boundary value analysis yields,
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
3
Modifying the software to match changes in the ever-changing environment is called as
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
4
Topic: Software Engineering → Software Cost Estimation COCOMO stands for-
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
5
Which of the following is not a Non-functional requirement?
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
6
For the following set of processes scheduled using FCFS policy, determine the average waiting time. Assume that the pro…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
7
Consider an operating system capable of loading and executing a single sequential user process at a time. The disk head…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
8
The main function of the microkernel is to provide a communication facility between the __________ program and the vari…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
9
In Linux Operating System, when __________ is invoked, it is passed a set of flags that determine how much sharing is t…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
10
Which of the following statements is correct, according to the following instance of the relational schema R(X, Y, Z)?&…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)

Next 10 Questions — UGC NET Computer Science Dec 2022 Shift II (Paper II)

Ascending by ID
1
Given the FFT we can have ______ time procedure for multiplying two polynomials $A(x)$ and $B(x)$ of degree bound $n$ w…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
2
Consider the Graph below: How many spanning trees can be found? 
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
3
The transition function $\delta$ in multi-tape Turing machine is defined as:
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
4
In Pumping Lemma for regular languages, to say a language is satisfying pumping lemma, what is the minimum length of $y…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
5
The item generated by the production $A \to \epsilon$ is:
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
6
In the $\epsilon$-NFA, $M=({q_0,q_1,q_2,q_3},{a},\delta,q_0,{q_3})$ where $\delta$ is given in the transition table bel…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
7
Given Ethernet address $010110100001000101010101000110001010101000001111$ in binary, what is the address in hexadecimal…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
8
In the standard Ethernet with transmission rate of $10$ Mbps, assume that the length of the medium is $2500$ m and size…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
9
In CRC coding if the data word is $111111$, divisor is $1010$ and the remainder is $110$. Which of the following code i…
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
10
The $A^*$ algorithm is optimal when,
Topic: UGC NET Computer Science Dec 2022 Shift II (Paper II)
Ask Your Question or Put Your Review.

loading...