| List I (Hashing Collision Handling Method) | List II (Strategy) |
|---|---|
| A. Chaining | I. Check next slot |
| B. Linear Probing | II. Use second hash function |
| C. Quadratic Probing | III. Linked list at index |
| D. Double Hashing | IV. Skip slots using quadratic step |
| List I | List II |
|---|---|
| A. Bellman-Ford algorithm | I. $O(m\log n)$ |
| B. Kruskal's algorithm | II. $O(n^3)$ |
| C. Floyd-Warshall algorithm | III. $O(n*m)$ |
| D. Topological sorting | IV. $O(n+m)$ |
The number of different binary trees possible with $n$ nodes is given by the Catalan number.
Catalan number formula is:
$C_n=\frac{1}{n+1}\binom{2n}{n}$
So, the number of different binary trees possible with $n$ nodes is:
$\frac{1}{n+1}\binom{2n}{n}$
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?
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$
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.