C-Dynamic Memory Allocation and Data Structure Questions and Answers
Practice ModeShowing 10 of 104 questions
Q21
How many number of interchange to be done for sorting the keys in non-decreasing order by bubble sort of the given array.
int A[ ]={7, 9, 11, 13, 15, 20, 3};
Answer: Option B
Q22
Return value of malloc is
Answer: Option B
Q23
What is the scope of memory allocated with malloc function ?
Answer: Option B
Q24
Consider the following C function
int f(int n)
{
static int i=1;
if (n>=i)
return n;
n=n+1;
i++;
return f(n);
}
The value return by f(1) is
Answer: Option B
Q25
Consider the following C function :
int f(int n)
{
static int r=0;
if(n<=0)
return 1;
if (n>3)
{
r=n;
return (f(n-1)+2;
}
return f(n-1)+8;
}
What is the value of f(1)?
Answer: Option C
Q26
A linked list is a
Answer: Option B
Q27
How many number of comparison to be done for sorting the keys in non decreasing order by bubble sort of the given array
int A[ ]={3, 7,. 9, 12, 15, 20};
Answer: Option B
Q28
An Abstract Data Type (ADT) is :
Answer: Option B
Q29
Find closed form of the recurrence.
F (n) =1 if n=1
F (n)=F(n-1+n otherwise
Answer: Option A
Q30
How many numbeer of comparison is required to find the minimum and maximum at a given list A element having a number of elements.
Answer: Option A