Data structure MCQ Quiz Hub

Data Structure and Algorithms (DSA) set 4

Choose a topic to test your knowledge and improve your Data structure skills

1. Which of the following statement is true about char ****a ?




2. Are *ptr++ and ++*ptr are same?




3. What will be the output of the following code? Void main(){int a=10;int *b=&a;int **c=&b;printf("%d %d %d",a,*b,**c);}




4. Which of the following is a collection of different data type elements?




5. What is the similarity between structure,union and enum?




6. The members of the union are accessed by____




7. How many bits are absolutely necessary to store an ASCII character ?




8. The result of 0001 1010 & 0000 1000 is ___




9. The result of 0001 1010^0001 0000 is____




10. The result of 0001 1010 << 2 is____




11. The most significant bit is lost in following operation




12. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ char c=125; c=c+10; printf("%d",c); return 0; }




13. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int i=4,x; x=++i + ++i + ++i; printf("%d",x); return 0; }




14. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int a=2; if(a==2){ a=~a+2<<1; printf("%d",a); } else{ break; } return 0; }




15. . #include <stdio.h> #include <string.h> int main(){ int i=0; for(;i<=2;) printf(" %d",++i); return 0; }




16. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int array[]={10,20,30,40}; printf("%d",-2[array]); return 0; }




17. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int i=10; static int x=i; if(x==i) printf("Equal"); else if(x>i) printf("Greater than"); else printf("Less than"); return 0; }




18. What will be output if you will compile and execute the following c code? #include<stdio.h> #define max 5; int main(){ int i=0; i=max++; printf("%d",i++); return 0; }




19. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ double far* p,q; printf("%d",sizeof(p)+sizeof q); return 0; }




20. C language was invented by




21. The data type created by the data abstraction process is called




22. A variable which is visible only in the function in which it is defined, is called




23. Which of the following data structure is linear type ?




24. Unsigned integers occupies




25. Unsigned integers occupies




26. In C, if you pass an array as an argument to a function, what actually gets passed?




27. Which data structure allows deleting data elements from front and inserting at rear?




28. Queue is a -------------- List .




29. A node in a linked list must contain at least




30. Consider that n elements are to be sorted. What is the worst case time complexity of Bubble sort?




31. The complexity of linear search algorithm is




32. Which of the following data structure is linear data structure?




33. What is the maximun number of dimensions an array in C may have?




34. An external variable




35. The declaration "unsigned u" indicates u is a/an




36. A declaration "short int" is used for variables




37. Which of the following 'C' type is not a primitive data structure?




38. The program fragment int i = 263 ; putchar (i) ; prints




39. The variables which can be accessed by all modules in a program, are called




40. The main measures of efficiency of an algorithm are




41. The worst case occures in linear search algorithms when




42. the terms push and pop are related to




43. What will be the output of the program? #include<stdio.h> int main() { int X=40; { int X=20; printf("%d ", X); } printf("%d ", X); return 0; }




44. What additional requirement is placed on an array, so that binary search may be used to locate an entry?




45. One difference between a queue and a stack is:




46. If the characters 'D', 'C', 'B', 'A' are placed in a queue (in that order), and then removed one at a time, in what order will they be removed?




47. Which of the following formulas in big-O notation best represent the expression n²+35n+6?




48. What term is used to describe an O(n) algorithm




49. The keyword used to transfer control from a function back to the calling function is




50. How many times the program will print "Amrutvahini" ? #include<stdio.h> int main() { printf("Amrutvahini"); main(); return 0; }




51. What will be the output of the program? #include<stdio.h> int i; int fun(); int main() { while(i) { fun(); main(); } printf("Hello "); return 0; } int fun() { printf("Hi"); }




52. In a linked list, the pointer of the last node contains a special value, called the ______ pointer.




53. In a ________ linked list, the last node's link field points to the first node of the list.




54. The second part of the node, is called _______ field, and contains the address of the next node in the list.




55. The link list also contains a list pointer variable called start or ________.




56. A ________ linked list is a linked list structure in which each node has a pointer to both its successor and predecessor.




57. _____ list is a special list that is maintained, which consists of unused memory cells.




58. ______ is a technique using which a computer periodically collects all the deleted space onto the free storage list.




59. ___ attacks the problem of fragmentation by moving all the allocated blocks to one end of memory, thus combining all the holes.




60. A ________ linked list is a linked list which always contains a special node, called the header node.




61. A polynomial can be represented in a _______ by just storing the coefficient and exponent of each term.




62. ______ refers to situation where one wants to delete data form a data structure that is empty




63. ________ is an organization that provides faster request and return time response.




64. _____ attacks the problem of fragmentation by moving all the allocated blocks to one end of memory, thus combining all the holes.




65. A _______ list structure can be traversed in two directions-- in the forward direction from beginning of the list to end, or in the backward direction, from the end of the list to the beginning.




66. ____ header list combines the advantages of a two-way list and a circular header list.




67. In linked list,a node contain




68. In linked list,the logical order of elements




69. Null pointer is used to tell




70. List pointer variable in linked list contains address of the




71. Because of linear structure of linked list having linear ordering,there is similarity between linked list and array in




72. Searching of linked list requires linked list to be created




73. A circular list can be used to represent




74. To insert a node in a circular list at rear end it should be inserted at …...of the queue




75. In a circularly linked list organisation ,insertion of a record involves the modifications of




76. What is true about linked kist?




77. A node of linked list contains_______




78. Which nodes contains a null pointer in a linked list?




79. Deletion of a node from an empty linked list will cause________




80. Insertion in a linked list requires modification of____pointers