Wednesday, 20 September 2017

Top 25 Objective Questions with their Answers of Data Structures

1. Which out of these is a non-linear data-structure:
a. arrays           
b.linked-lists
c. queues           
d. tree

2. A stack is a data-structure in which elements are stored and retrieved by:

a. FIFO method       
b.LIFO method
c. FCFS method       
d. None of the above

3. The different types of arrays are:

a. One & Multi-dimensional   
b. int and float
c. int,char,float       
d. One & Two dimensional

4. An array is passed into a function:

a. by value           
b. by reference
c. element by element       
d. Any of the above

5. A queue is a data-structure in which elements are stored and retrieved by:

a. FIFO method   
b.LIFO method
c. FCFS method       
d. None of the above

6. If an array with the name, A exists which of the following statements is incorrect:

a. A++           
b. printf(“%d”,*(A+1))
c. printf(“%u”,A+1)       
d. All are correct

7. An uninitialized pointer is known as:

a. dangling pointer       
b. NULL pointer
c. generic pointer       
d. None of the above

8. The unary operator used with pointer variable to indirectly access the contents of memory location pointed to by the pointer is called

a. Address-of operator       
b. dot operator
c. indirection operator       
d. asterisk operator

9. The arithmetic operation performed on pointer variables:

a. multiplication of an integer with pointer   
b. addition of two pointers
c. subtraction of two pointers       
d. addition of a float to a pointer

10. Two ways to access elements of an array are:

a. by value and by reference     
b. indexed and pointer notation
c. sequential and random     
d. none of the above

11. The functions used for dynamic memory allocation are:

a. delete and free       
b. free and realloc
c. malloc and free       
d. malloc and calloc

12. An array can be categorized as which type of data-structure:

a. dynamic           
b. static
c. int/char/float       
d. multi-dimensional

13. The function used in C to de-allocate a memory block is:

a. delete            
b. free
c. malloc            
d. realloc

14. A collection of elements of different data-types is known as:

a. array           
b. union
c. structure           
d. linked list

15. To access elements of a structure through a pointer , the operator used is:

a. .           
b. ->
c. <-           
d. *

16. A structure having atleast one of its members of the same type as the structure itself:

a. reference structure       
b. nested structure
c. self-referential structure   
d. none of the above

17. A one-way list is called:

a. circular linked list       
b. array
c. queue           
d. single linked list

18. An orphaned block is the result of:

a. memory leak       
b. garbage collection
c. free function       
d. all of the above

19. A ____ pointer  can point to any data-type:

a. NULL pointer       
b. void pointer
c. dangling pointer       
d. such a pointer does not exist

20. If p1 and p2 are pointers of integer type and x is also an integer-type of variable, which of these expressions is valid:

a. p1*x           
b. p2+x
c. p1+p2           
d.p1*p2

21. A linked list can be represented using two ways which are:

a. single and double       
b. single and circular
c. static and dynamic       
d. any of the above

22. Dynamic memory allocation for a node in a linked list is done from:

a. RAM           
b. ROM
c. Hard disk           
d. Heap

23. A linked list is a linear collection of homogeneous elements called:

a. structures           
b. nodes
c. data           
d. none of the above

24. Insertion in a linked list can be done from:

a. beginning           
b. end
c. middle           
d. all of the above

25. The traversal directions possible in a double-linked list are:

a. forward           
b. backward
c. forward and backward   
d. right 


 Keep Learning...................

Thanks
Sidhant Sharma
B.Tech Student
Chitkara University HP.

No comments:

Post a Comment

Thanks
Mukesh Rajput