81. The fleury's algorithm can be applied to a graph if the degree of all the vertices is even or two vertices with an odd degree.
82. Consider the following recursive implementation used to convert a decimal number to its binary equivalent:
#include<stdio.h>
int arr[31], len = 0;
void recursive_dec_to_bin(int n)
{
if(n == 0 && len == 0)
{
arr[len++] = 0;
return;
}
if(n == 0)
return;
__________;
recursive_dec_to_bin(n/2);
}
int main()
{
int n = 100,i;
recursive_dec_to_bin(n);
for(i=len-1; i>=0; i--)
printf("%d",arr[i]);
return 0;
}
Which of the following lines should be inserted to complete the above code?
#include<stdio.h>
int arr[31], len = 0;
void recursive_dec_to_bin(int n)
{
if(n == 0 && len == 0)
{
arr[len++] = 0;
return;
}
if(n == 0)
return;
__________;
recursive_dec_to_bin(n/2);
}
int main()
{
int n = 100,i;
recursive_dec_to_bin(n);
for(i=len-1; i>=0; i--)
printf("%d",arr[i]);
return 0;
}
Which of the following lines should be inserted to complete the above code?83. Route cipher is closely related to?
84. The Euclid's algorithm runs efficiently if the remainder of two numbers is divided by the minimum of two numbers until the remainder is zero.
85. Subset sum problem is an example of NP-complete problem.
86. What is the output of the following code?
#include<stdio.h>
int cnt =0;
int my_function(int n, int sm)
{
int i, tmp_sm;
for(i=1;i<=n;i++)
{
tmp_sm = recursive_sum_of_digits(i);
if(tmp_sm == sm)
cnt++;
}
return cnt;
}
int recursive_sum_of_digits(int n)
{
if(n == 0)
return 0;
return n % 10 + recursive_sum_of_digits(n/10);
}
int main()
{
int n = 20, sum = 3;
int ans = my_function(n,sum);
printf("%d",ans);
return 0;
}
#include<stdio.h>
int cnt =0;
int my_function(int n, int sm)
{
int i, tmp_sm;
for(i=1;i<=n;i++)
{
tmp_sm = recursive_sum_of_digits(i);
if(tmp_sm == sm)
cnt++;
}
return cnt;
}
int recursive_sum_of_digits(int n)
{
if(n == 0)
return 0;
return n % 10 + recursive_sum_of_digits(n/10);
}
int main()
{
int n = 20, sum = 3;
int ans = my_function(n,sum);
printf("%d",ans);
return 0;
}
87. In which of the following cipher the plain text and the ciphered text have same set of letters?
88. What is the bidirectional variant of selection sort?
89. In recursion, the condition for which the function will stop calling itself is . . . . . . . .
90. Stack can be reversed without using extra space by . . . . . . . .
Read More Section(Miscellaneous on Data Structures)
Each Section contains maximum 100 MCQs question on Miscellaneous on Data Structures. To get more questions visit other sections.
- Miscellaneous on Data Structures - Section 1
- Miscellaneous on Data Structures - Section 2
- Miscellaneous on Data Structures - Section 3
- Miscellaneous on Data Structures - Section 4
- Miscellaneous on Data Structures - Section 5
- Miscellaneous on Data Structures - Section 6
- Miscellaneous on Data Structures - Section 7
- Miscellaneous on Data Structures - Section 8
- Miscellaneous on Data Structures - Section 9
- Miscellaneous on Data Structures - Section 11
- Miscellaneous on Data Structures - Section 12