DSA CA3 Questionaire 2nd Year CSE A
DSA CA3 Questionaire 2nd Year CSE A
i) Stack
ii) Arrays
iii) LinkedList
iv) All of the above
int main ()
{
int arr[5] = {13, 34, 67, 15, 45};
int *x=arr;
int y=*x + 2;
printf("%d", y);
return 0;
}
a. 34
b. 67
c. 15
d. 45
14. What will be the resulting array after rotating arr[]={1, 2, 3, 4, 5} by 2 anti-
clockwise?
a. 2, 1, 3, 4, 5
b. 3, 4, 5, 1, 2
c. 4, 5, 1, 2, 3
d. 1, 2, 3, 5, 4
15. A data structure is said to be _____ if its elements form a sequence.
16. How is the 2nd element in an array accessed based on pointer notation?
a. *a + 2
b. *(a + 2)
c. *(*a + 2)
d. &(a + 2)
17. Which of the following is a disadvantage of dynamic arrays?
a. Locality of reference
b. Data cache utilisation
c. Random access
d. Memory leak
18. struct Node{
int data;
struct Node* next;
};
struct Node* head;
int main(){
int c = sizeof(head);
printf("The size of the Node is %d",c);
return 0;
}
a. 4
b. 6
c. 8
d. 10
19. If the address of arr[1] of the given array is -1730151612, and it takes a space
of 4 bytes in the memory, then what will be the output of the programme ?
int main ()
{
int arr[8]={5, 10, 15, 20, 25, 65, 34, 89};
int *x = &arr[2];
printf("%d", x+5);
return 0;
}
a. -1730151613
b. -1730151621
c. -1730151603
d. -1730151588
20. An array is declared as: int arr[n][n]; Each element follows the condition: f[j][i]=(j-i).
What is the sum of all the elements of the array arr?
5 marks question