JHARKHAND RAKSHA SHAKTI UNIVERSITY
End Semester (Semester I) Examination February 2021
Subject: Programming using C & Data Structure using C F. M.: 50
Semester: BCACS-101 Time: 2 Hrs. P.M.: 23
Section A
Q. 1 is compulsory 1X10=10
1. Which of the following is the correct way of declaring an array?
i. int jrsu[10];
ii. int jrsu;
iii. jrsu{20};
iv. array jrsu[10];
2. How can we initialize an array in C language?
i. int arr[2]=(10, 20)
ii. int arr(2)={10, 20}
iii. int arr[2] = {10, 20}
iv. int arr(2) = (10, 20)
3. Which of the following is the advantage of the array data structure?
i. Elements of mixed data types can be stored.
ii. Easier to access the elements in an array
iii. Index of the first element starts from 1.
iv. Elements of an array cannot be sorted
4. Which of the following highly uses the concept of an array?
i. Binary Search tree
ii. Caching
iii. Spatial locality
iv. Scheduling of Processes
5. Which of the following is the disadvantage of an array?
i. Stack and Queue data structures can be implemented through an array.
ii. Index of the first element in an array can be negative
iii. Wastage of memory if the elements inserted in an array are lesser than the allocated size
iv. Elements can be accessed sequentially.
6. What will be the output of the following code?
#include <stdio.h>
int main()
{
int arr[5]={10,20,30,40,50};
printf("%d", arr[5]);
return 0;
}
i. Garbage value
ii. 10
iii. 50
iv. None of the above
7. Which one of the following is the size of int arr[9] assuming that int is of 4 bytes?
i. 9
ii. 36
iii. 35
iv. None of the above
8. Which one of the following is the process of inserting an element in the stack?
i. Insert
ii. Add
iii. Push
iv. None of the above
9. Which of the following is a linear data structure?
a. Array
b. AVL trees
c. Binary trees
d. Graphs
10. Which of the following is not the type of queue?
i. Priority queue
ii. Single ended queue
iii. Circular queue
iv. Ordinary queue
II. Short Answer Questions. Attempt any FOUR. 5 MARKS
1. Why does last element of a linked list hold null in its address part?
2. Write a program in C to create an array.
3. Classify ADT queue.
4. Define node in tree. Differentiate between general node and header node of data
structure.
5. What is tree traversal? Describe with its types.
6. What is meant by Binary Search Tree? Explain with suitable example.
7. Define graph data structure.
III. Long Answer Questions. Attempt any TWO. 10 MARKS
1. Discuss linked list with its types.
2. Prepare a queue data structure by demonstrating example and explain with its types.
3. Write a program in C to illustrate bubble sort.
4. Differentiate between merge sort and selection sort with suitable example.
********