Documente Academic
Documente Profesional
Documente Cultură
School of Engineering
III in Semester Examinations November 2016
MCA Semester V
Professionals Skill II
Paper code: MCA-044A
Time:1:30 hrs Maximum marks: 50
Instructions:
1. Answer all questions.
2. Write legibly on both sides of the answer book.
3. Write relevant question numbers before writing the answer.
Q1. In C, if you pass an array as an argument to a function, what actually gets passed?
A. Value of elements in array
B. First element of the array
C. Base address of the array
D. Address of the last element of array
Q2.The keyword used to transfer control from a function back to the calling function is
A. switch B. goto
C. go back D. return
Q3.How many times the program will print " JECRCU " ?
#include<stdio.h>
int main()
{
printf("JECRCU");
main();
return 0;
}
Q4.How will you free the memory allocated by the following program?
#include<stdio.h>
#include<stdlib.h>
#define MAXROW 3
#define MAXCOL 4
int main()
{
int **p, i, j;
p = (int **) malloc(MAXROW * sizeof(int*));
return 0;
}
Q6. .. Is a pile in which items are added at one end and removed from the other.
A) Stack B) Queue
C) List D) None of the above
Q7. When new data are to be inserted into a data structure, but there is not available space; this situation is
usually called....
A. Underflow B. overflow
C. houseful D. saturated
Q8. Selection sort first finds the .......... element in the list and put it in the first position.
A. Middle element B. Largest element
C. Last element D. Smallest element
Q9. Which of the following sorting algorithm is of divide and conquer type?
A. Bubble sort B. Insertion sort
C. Merge sort D. Selection sort
Q10. What is the output of this C code?
#include <stdio.h>
int main()
{
printf("before continue ");
continue;
printf("after continue\n");
}
a) Before continue after continue
b) Before continue
c) After continue
d) Compile time error
Q11. main() {
Int a=3, b=2, c*d*e;
d=&a; e=&b;
c=*d+*e;
}
Which one of the given answers is correct?
A) a=4, c-6 B) a=3, c=5
C) a=3, c=6 D) a=3, c=8
}
a) 4 b) 5
c) Compile time error d) 3
Q 15. In binary heap, whenever the root is removed then the rightmost element of last level is replaced by the
root. Why?
A - It is the easiest possible way.
B - To make sure that it is still complete binary tree.
C - Because left and right sub tree might be missing.
D - None of the above!
Q 16. Which of the following algorithm does not divide the list
A - linear search B - binary search
C - merge sort D - quick sort
Q 17. For a binary search algorithm to work, it is necessary that the array (list) must be
A sorted B - unsorted
C - in a heap D - popped out of stack
Q 18. Visiting root node after visiting left and right sub-trees is called
A - In-order Traversal B - Pre-order Traversal
C - Post-order Traversal D- None of the above
Q 22Heap is an example of
A - complete binary tree
B - spanning tree
C - sparse tree
D - binary search tree