1. | It exports a set of operations |
A. | true, false |
B. | false, true |
C. | true, true |
D. | false, false |
Answer» C. true, true |
2. | A graph is said to be complete if there is no edge between every pair of vertices. |
A. | true, false, true |
B. | true, true, false |
C. | true, true, true |
D. | false, true, true |
Answer» B. true, true, false |
3. | Space Complexity iii) Is the strategy guaranteed to find the solution when there in one. |
A. | a-iii, b-ii, c-i |
B. | a-i, b-ii, c-iii |
C. | a-iii, b-i, c-ii |
D. | a-i, b-iii, c-ii |
Answer» C. a-iii, b-i, c-ii |
4. | The time complexity of binary search is O(logn). |
A. | true, false |
B. | false, true |
C. | false, false |
D. | true, true |
Answer» D. true, true |
5. | A graph is said to be complete if there is an edge between every pair of vertices. |
A. | true, true |
B. | false, true |
C. | false, false |
D. | true, false |
Answer» A. true, true |
6. | To find the predecessor, it is required to traverse the list from the first node in case of singly linked list. |
A. | i-only |
B. | ii-only |
C. | both i and ii |
D. | none of both |
Answer» C. both i and ii |
7. | Nodes that are not root and not leaf are called as internal nodes. |
A. | true, true |
B. | true, false |
C. | false, true |
D. | false, false |
Answer» C. false, true |
8. | A node is child node if out degree is one. |
A. | true, true |
B. | true, false |
C. | false, true |
D. | false, false |
Answer» B. true, false |
9. | Insertion b) Deletion c) Retrieval d) Traversal |
A. | only a,b and c |
B. | only a and b |
C. | all of the above |
D. | none of the above |
Answer» D. none of the above |
10. | In strictly binary tree, the out-degree of every node is either o or 2. |
A. | true, false |
B. | false, true |
C. | true, true |
D. | false, false |
Answer» C. true, true |
11. | The complexity of the average case of an algorithm is |
A. | much more complicated to analyze than that of worst case |
B. | much more simpler to analyze than that of worst case |
C. | sometimes more complicated and some other times simpler than that of worst case |
D. | none or above |
Answer» A. much more complicated to analyze than that of worst case |
12. | The Average case occur in linear search algorithm |
A. | when item is somewhere in the middle of the array |
B. | when item is not in the array at all |
C. | when item is the last element in the array |
D. | when item is the last element in the array or is not there at all |
Answer» A. when item is somewhere in the middle of the array |
13. | Which of the following case does not exist in complexity theory |
A. | best case |
B. | worst case |
C. | average case |
D. | null case |
Answer» D. null case |
14. | The space factor when determining the efficiency of algorithm is measured by |
A. | counting the maximum memory needed by the algorithm |
B. | counting the minimum memory needed by the algorithm |
C. | counting the average memory needed by the algorithm |
D. | counting the maximum disk space needed by the algorithm |
Answer» A. counting the maximum memory needed by the algorithm |
15. | The time factor when determining the efficiency of algorithm is measured by |
A. | counting microseconds |
B. | counting the number of key operations |
C. | counting the number of statements |
D. | counting the kilobytes of algorithm |
Answer» B. counting the number of key operations |
16. | Two main measures for the efficiency of an algorithm are |
A. | processor and memory |
B. | complexity and capacity |
C. | time and space |
D. | data and space |
Answer» C. time and space |
17. | Computers are used for processing numerical data called _______ data. |
A. | float |
B. | local |
C. | character |
D. | non-local |
Answer» C. character |
18. | Each programming language contains a ______ set that is used to communicate with the computer. |
A. | character |
B. | integer |
C. | float |
D. | numeric |
Answer» A. character |
19. | Finite sequence S of zero or more characters is called _______. |
A. | array |
B. | list |
C. | string |
D. | block |
Answer» C. string |
20. | String with zero characters is called ________ string. |
A. | null |
B. | binary |
C. | totalled |
D. | list |
Answer» A. null |
21. | A computer which can access an individual byte is called a ________ machine. |
A. | memory addressable |
B. | byte addressable |
C. | bit |
D. | byte |
Answer» B. byte addressable |
22. | Groups of consecutive elements in a string, such as words, phrases and sentences are called ________. |
A. | main strings |
B. | substring |
C. | index |
D. | block |
Answer» B. substring |
23. | The number of characters in a string is called its ______. |
A. | length |
B. | breath |
C. | width |
D. | none |
Answer» C. width |
24. | _________ operation of word processing involves replacing one string in the text by another. |
A. | insertion |
B. | deletion |
C. | searching |
D. | replacement |
Answer» D. replacement |
26. | ________ is a linearly ordered sequence of memory cells. |
A. | node |
B. | link |
C. | variable |
D. | null |
Answer» A. node |
27. | Each node in a linear list contains an item called _______ which points to the next node in the list. |
A. | node |
B. | link |
C. | variable |
D. | null |
Answer» B. link |
28. | _______ is a variable whose length may vary during the execution, but the length cannot exceed a maximum values defined before the program is executed. |
A. | dynamic |
B. | static |
C. | semi static |
D. | global |
Answer» C. semi static |
29. | In _______ storage, each cell is divided into two parts—- the path stores a single character, while the second part contains the address of the cell containing the next character. |
A. | fixed length |
B. | linked list |
C. | variable length |
D. | sequential |
Answer» B. linked list |
30. | If string 1 = John, and string 2 = Rivers are merged, the process is called —- |
A. | insertion |
B. | deletion |
C. | concatenation |
D. | replacement |
Answer» C. concatenation |
31. | _____ is a variable whose length may vary during the execution of a program. |
A. | dynamic |
B. | static |
C. | semi static |
D. | global |
Answer» A. dynamic |
32. | _______ is a structure used to represent the linear relationship between elements by means of sequential memory locations. |
A. | linked list |
B. | array |
C. | pointer |
D. | stack |
Answer» B. array |
33. | A ______ is a list of a finite number of homogeneous data elements. |
A. | linear array |
B. | pointer |
C. | linked list |
D. | tree |
Answer» A. linear array |
34. | The number of elements n is called the length or _____ of the array. |
A. | upper bound |
B. | lower bound |
C. | size |
D. | variable |
Answer» C. size |
35. | The number K in A[K] is called the subscript or the ________. |
A. | size |
B. | index |
C. | variable |
D. | constant |
Answer» B. index |
36. | Which of the following items are not part of the array declaration? |
A. | name of the array |
B. | data type of the array |
C. | index set of the array |
D. | length of the array |
Answer» D. length of the array |
37. | Programming languages like FORTRAN and PASCAL allocate memory space for arrays ______. |
A. | dynamically |
B. | statically |
C. | successively |
D. | alternatively |
Answer» B. statically |
38. | The process of accessing and processing each element of an array A, exactly once is called _______. |
A. | deleting |
B. | inserting |
C. | traversing |
D. | searching |
Answer» C. traversing |
39. | _________ refers to the operations of rearranging the elements of an array A so that they are in increasing order. |
A. | searching |
B. | sorting |
C. | traversing |
D. | inserting |
Answer» B. sorting |
40. | Two dimensional arrays are sometimes called _______ arrays. |
A. | integer |
B. | boolean |
C. | matrix |
D. | real |
Answer» C. matrix |
41. | ________ is a list in which the order of the items is significant, and the items are not necessarily sorted. |
A. | ordered list |
B. | indexed list |
C. | sequential list |
D. | unordered list |
Answer» C. sequential list |
42. | Representation of a two dimensional as one single column of rows and mapping it sequentially is called _______ representation. |
A. | row-major |
B. | row |
C. | column-major |
D. | column |
Answer» A. row-major |
43. | Matrices with relatively high proportion of zero entries are called ______ matrices. |
A. | triangular |
B. | diagonal |
C. | sparse |
D. | adjacency |
Answer» C. sparse |
44. | _______ arrays are where the elements in the different arrays with the same subscript belongs to the same record. |
A. | one dimensional |
B. | parallel |
C. | two dimensional |
D. | static |
Answer» B. parallel |
45. | Records can be stored in an area of memory called _______ memory. |
A. | dynamic |
B. | static |
C. | simple |
D. | parallel |
Answer» A. dynamic |
46. | A matrix in which non-zero entries can only occur on the diagonal or on elements immediately above or below the diagonal, is called ______ matrix. |
A. | triangular |
B. | tridiagonal |
C. | sparse |
D. | simple |
Answer» C. sparse |
47. | Elements of of an arrays are accessed by |
A. | accessing fuction in built in data structure |
B. | mathematical fuction |
C. | index |
D. | none of the above |
Answer» C. index |
48. | Array is a |
A. | index data structure |
B. | non liturenear data structure |
C. | complx data structure |
D. | none of the above |
Answer» D. none of the above |
49. | Row -major order in two -dimentional array refers to an arrangement where |
A. | all elements of a row are stored in memory in sequence followed by next row in sequence,and so on |
B. | all elements of row are stored in memory in sequence followed by next column in sequence ,and so on |
C. | all elements of row are stored in memory in sequence followed by next column in sequence |
D. | none of the above |
Answer» A. all elements of a row are stored in memory in sequence followed by next row in sequence,and so on |
51. | how many vlue can held by an array A(-1…m,1…m)? | |
A. | m | |
B. | m^2 | |
C. | m(m+1) | |
D. | m(m+2) | |
Answer» D. m(m+2) | ||
52. | let x be the adjacency matrix of a graph .G with no self loop.The entries along the principle diagonal of x are |
A. | all “0” |
B. | all “1” |
C. | both 0&1 |
D. | different |
Answer» A. all “0” |
53. | _______ refers to the operation of finding the location of a given item in a collection of items. |
A. | sorting |
B. | searching |
C. | function |
D. | complexity |
Answer» B. searching |
54. | _______ is a field whose values uniquely determine the records in the file. |
A. | pointer |
B. | primary key |
C. | secondary key |
D. | function |
Answer» B. primary key |
55. | By using which of the following methods sorting is not possible? |
A. | insertion |
B. | exchange |
C. | selection |
D. | deletion |
Answer» D. deletion |
56. | Which is the simplest file structure? |
A. | sequential |
B. | indexed |
C. | random |
D. | bubble |
Answer» A. sequential |
57. | A ______ is a data structure use foe a storage of a records. |
A. | tree |
B. | hash table |
C. | stack |
D. | graph |
Answer» B. hash table |
58. | _________ is a search for data that uses an index to locate the item. |
A. | binary search |
B. | sequential search |
C. | indexed search |
D. | jump search |
Answer» C. indexed search |
59. | If the input array is unsorted, then only a linear ______ can be used. |
A. | binary search |
B. | sequential search |
C. | indexed search |
D. | jump search |
Answer» B. sequential search |
60. | _______ is a attribute of a sort, indicating that data with equal keys maintain their relative input order in the output. |
A. | sort order |
B. | sort stability |
C. | sort efficiency |
D. | collision |
Answer» B. sort stability |
61. | In ______ method of hashing, selected digit are extracted from the key and used as the address. |
A. | subtraction |
B. | digit extraction |
C. | rotation |
D. | folding |
Answer» B. digit extraction |
62. | ________ hashing method is used in combination with other methods. |
A. | subtraction |
B. | digit extraction |
C. | rotation |
D. | division |
Answer» C. rotation |
63. | If two different keys yield the same hash address, it is called _______ . |
A. | binary search |
B. | sequential search |
C. | collision |
D. | rotation |
Answer» C. collision |
64. | The ______ sort algorithm is called diminishing increment sort. |
A. | merge |
B. | radix |
C. | shell |
D. | selection |
Answer» C. shell |
65. | A ______ merge sort uses a constant number of input merge files and the same number of output merge files. |
A. | k-way |
B. | balanced |
C. | polyphase |
D. | radix |
Answer» B. balanced |
66. | ________ method of collision resolution involves maintaining two tables in memory. |
A. | linear probing |
B. | chaining |
C. | quadratic probing |
D. | double hashing |
Answer» B. chaining |
67. | _______ is a merge sort that sorts a data stream using repeated merges. |
A. | balanced |
B. | polyphase |
C. | radix |
D. | k-way |
Answer» D. k-way |
68. | One of the statement is false |
A. | tree is an abstract data type |
B. | array is a linear data structure |
C. | typedef is derived data type |
D. | float is built in data type |
Answer» C. typedef is derived data type |
69. | Examples of sorting algorithms are |
A. | bubble sort |
B. | selection sort |
C. | insertion sort |
D. | (a),(b),and © |
Answer» D. (a),(b),and © |
70. | Give timing complexities of three sorting algorithms bubble sort,selection sort,insertion sort respectively. |
A. | 0(log n), 0(log n), o(log n) |
B. | o(n2), o(n2), o(n2) |
C. | o(n2), o(n log n), o(n log n) |
D. | o(n log n), o(n2), o(n log n) |
Answer» B. o(n2), o(n2), o(n2) |
71. | _____passes are required to sort n data using bubble sort. |
A. | n |
B. | n-1 |
C. | n+2 |
D. | n-2 |
Answer» B. n-1 |
72. | Best and the worst case timing complexities of insertion sort are_________. |
A. | o(n2), o(n2) |
B. | o(n log n), o(n2) |
C. | o(n), o(n2) |
D. | o(n), o(n3) |
Answer» C. o(n), o(n2) |
73. | Which sorting algorithm can exploit the partially sorted data in a list? |
A. | bubble sort |
B. | selection sort |
C. | insertion sort |
D. | all of them |
Answer» C. insertion sort |
74. | Sorting is useful for_________ |
A. | report genration |
B. | minimizing the storage needed |
C. | making searching easier and efficient |
D. | responding to queries easily |
Answer» C. making searching easier and efficient |
76. | The function islower(char)checks whether a character is in lower case or not.Therefore it should return______ |
A. | 0 or 1 |
B. | -1, 0 or 1 |
C. | a character |
D. | nothing |
Answer» A. 0 or 1 |
77. | A variable P is called pointer if__ |
A. | p contains the address of an element in data |
B. | p points to the address of first element in data |
C. | p can store only memory address |
D. | p contain the data and the address of data |
Answer» A. p contains the address of an element in data |
78. | Which of the following data structure can’t store the non-homogeneous data element? |
A. | arrays |
B. | records |
C. | pointers |
D. | none |
Answer» A. arrays |
79. | The difference between linear array and a record is_____ |
A. | an array is suitable for homogeneous data but the data items in a record may have different data type |
B. | in a record,theremay not be a natural ordering in opposed ti linear array |
C. | a record form a hierarchical structure but a linear array does not |
D. | all of above |
Answer» D. all of above |
80. | If s1 is “ABC” and s2 is “DEF” then strcat(s1,s2)will give the following result. |
A. | s1=”abcdef” and s2=”def” |
B. | s1=”abcdef” and s2=”def” |
C. | s1=”abc” and s2=”abcdef” |
D. | s1=”abc” and s2=”abcdef” |
Answer» A. s1=”abcdef” and s2=”def” |
81. | Give output of the following programint main(){inta[]={2,3,4,5,6};printf(“%d”,2[a]);} |
A. | compilation error |
B. | run time error |
C. | 4 |
D. | 2 |
Answer» C. 4 |
82. | Where do we use the operator –> ? |
A. | to access a member of structure |
B. | to access member of union |
C. | to access an array |
D. | both(a) and(b). |
Answer» D. both(a) and(b). |
83. | The function strcmp(s1,s2)will return -1 if____ |
A. | s1>s2 |
B. | s1=s2 |
C. | s1<s2 |
D. | function does not return -1. |
Answer» C. s1<s2 |
84. | Which of the following data structure store the homogeneous data elements? |
A. | arrays |
B. | records |
C. | pointers |
D. | none |
Answer» B. records |
85. | The number of comparisons required to sort 5 numbers in ascending order using bubble sort are |
A. | 7 |
B. | 6 |
C. | 10 |
D. | 5 |
Answer» C. 10 |
86. | A sorting algorithm is stable if |
A. | its time complexity is constant irrespective of the nature of input |
B. | preserves the original order of records with equal keys |
C. | its space complexity is constant irrespective of the nature of input |
D. | it sorts any volume of data in a constant time |
Answer» B. preserves the original order of records with equal keys |
87. | The average case complexity of Insertion Sort is |
A. | o(2n) |
B. | o(n3) |
C. | o(n2) |
D. | o(2n) |
Answer» C. o(n2) |
88. | A sorted file contains 16 items. Using binary search, the maximum number of comparisons to search for an item in this file is |
A. | 15 |
B. | 8 |
C. | 1 |
D. | 4 |
Answer» D. 4 |
89. | A sort which compares adjacent elements in a list and switches where necessary is |
A. | insertion sort |
B. | heap sort |
C. | quick sort |
D. | bubble sort |
Answer» D. bubble sort |
90. | A sort which iteratively passes through a list to exchange the first element with any element less than it and then repeats with a new first element is called |
A. | insertion sort |
B. | selection sort |
C. | heap sort |
D. | quick sort |
Answer» B. selection sort |
91. | The number of swappings needed to sort the numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending order, using bubble sort is |
A. | 11 |
B. | 12 |
C. | 13 |
D. | 14 |
Answer» D. 14 |
92. | A sorting technique that guarantees that records with the same primary key occurs in the same order in the sorted list as in the original unsorted list is said to be |
A. | stable |
B. | consistent |
C. | external |
D. | linear |
Answer» A. stable |
93. | You want to check whether a given set of items is sorted. Which of the following sorting methods will be most efficient if it is already in sorted order? |
A. | bubble sort |
B. | selection sort |
C. | insertion sort |
D. | merge sort |
Answer» C. insertion sort |
94. | Which of the following sorting methods will be the best if number of swappings done, is the only measure of efficienty? |
A. | bubble sort |
B. | selection sort |
C. | insertion sort |
D. | merge sort |
Answer» B. selection sort |
95. | You are asked to sort 15 randomly generated numbers. You should prefer |
A. | bubble sort |
B. | selection sort |
C. | insertion sort |
D. | merge sort |
Answer» A. bubble sort |
96. | What is the number of swaps required to sort n elements using selection sort, in the worst case? |
A. | Θ(n) |
B. | Θ(n log n) |
C. | Θ(n2) |
D. | Θ(n2 log n) |
Answer» A. Θ(n) |
97. | The number of interchanges required to sort 5, 1, 6, 2 4 in ascending order using Bubble Sort is |
A. | 6 |
B. | 5 |
C. | 7 |
D. | 8 |
Answer» B. 5 |
98. | The smallest element of an array’s index is called its |
A. | lower bound |
B. | upper bound |
C. | range |
D. | extraction |
Answer» A. lower bound |
99. | Which of the following sorting methods would be most suitable for sorting a list which is almost sorted |
A. | bubble sort |
B. | selection sort |
C. | insertion sort |
D. | merge sort |
Answer» A. bubble sort |
101. | A sort which compares adjacent elements in a list and switches wherever necessary is _______ | |
A. | insertion sort | |
B. | bubble sort | |
C. | selection sort | |
D. | none of these | |
Answer» B. bubble sort | ||
102. | Which of the following sorting method is the slowest? |
A. | quick sort |
B. | merge sort |
C. | bubble sort |
D. | none of these |
Answer» C. bubble sort |
103. | Consider that n elements are to be sorted.The worst case complexity of bubble sort is____ |
A. | o(1) |
B. | o(log2n) |
C. | o(n) |
D. | o(n2) |
Answer» D. o(n2) |
104. | In bubble sort,for a file of size n,after p iterations number of records in proper position is____ |
A. | n-p |
B. | n-p+1 |
C. | n-p+2 |
D. | p |
Answer» A. n-p |
105. | In bubble sort,for a file of size n,during each pth pass the number of last records left out are____ |
A. | n-p |
B. | n-p+1 |
C. | p |
D. | p-1 |
Answer» D. p-1 |
106. | Given a file size n the number of times a given file is passed through in bubble sort is____ |
A. | n2 |
B. | n-1 |
C. | nlogn |
D. | logn |
Answer» A. n2 |
107. | Total number of comparision in bubble sort is____ |
A. | o(nlogn) |
B. | o(n2) |
C. | o(n) |
D. | none of these |
Answer» B. o(n2) |
108. | A sort which iteratively passes through a list to exchange the first element with any element less than it and then repeats with a new first element is called |
A. | insertion sort |
B. | selection sort |
C. | bubble sort |
D. | merge sort |
Answer» B. selection sort |
109. | The selection sort is basically a method of repeated |
A. | interchange |
B. | searching |
C. | position adjustment |
D. | none of these |
Answer» C. position adjustment |
110. | In selection sort of n elements,how many times is the swp function called in the complete execution of the algorithm? |
A. | 1 |
B. | n-1 |
C. | n(n-1)/2 |
D. | none of these |
Answer» B. n-1 |
111. | If two string are identical then strcmp() function returns____ |
A. | -1 |
B. | 1 |
C. | 0 |
D. | none of these |
Answer» C. 0 |
112. | How will you print\n on screen? |
A. | printf(“\\n”); |
B. | printf(\\\n\); |
C. | echo\\\\n; |
D. | printf(“\\\\n”); |
Answer» D. printf(“\\\\n”); |
113. | Following function is used to find the first occurrence of given string in another string |
A. | strchar |
B. | strnset |
C. | strstr |
D. | strrchr |
Answer» D. strrchr |
114. | Which of the following is more appropriate for reading a multi_word string? |
A. | printf |
B. | scanf |
C. | put |
D. | gets |
Answer» D. gets |
115. | What will be the output of the following code? Int main(){printf(“Hello”,”Word\n”);return 0;} |
A. | hello |
B. | hello world |
C. | world |
D. | none of these |
Answer» A. hello |
116. | What will be the output of the following code? Int main(){char str[9]=”My Computer”;printf(“%s\n”,str);return 0;} |
A. | mycompute |
B. | syntax error |
C. | runtime error |
D. | none of these |
Answer» B. syntax error |
117. | Pointer is a___________ |
A. | a keyword used to create a variable |
B. | a variable that stores the address of some instruction |
C. | a variable that stores the address of some other variable |
D. | all of the above |
Answer» C. a variable that stores the address of some other variable |
118. | ____operator is used to get the value stored at address stored in pointer variable |
A. | * |
B. | & |
C. | dot |
D. | + |
Answer» A. * |
119. | Which of the following statement is true about char ****a ? |
A. | a is pointer to a pointer to a pointer to char |
B. | a is pointer to a pointer to a pointer to char |
C. | a is a pointer to a char pointer |
D. | a is a pointer to a pointer to a char |
Answer» B. a is pointer to a pointer to a pointer to char |
120. | Are *ptr++ and ++*ptr are same? |
A. | no they are not same |
B. | yes they are one and the same |
C. | depends upon the value of ptr |
D. | none of these |
Answer» A. no they are not same |
121. | 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);} |
A. | 10 10 garbage |
B. | 10 garbage garbage |
C. | 10 10 10 |
D. | syntax error |
Answer» C. 10 10 10 |
122. | Which of the following is a collection of different data type elements? |
A. | array |
B. | structure |
C. | string |
D. | all of the above |
Answer» B. structure |
123. | What is the similarity between structure,union and enum? |
A. | all of them let you define new values |
B. | all of them let you define new pointers |
C. | all of them let you define new structure |
D. | all of them let you define new data types |
Answer» D. all of them let you define new data types |
124. | Which of the following can not be a structure member? |
A. | another structure |
B. | array |
C. | function |
D. | none of these |
Answer» C. function |
126. | a-> is systematically correct if_____ |
A. | a is a pointer to a structure in which b is a field |
B. | a and b are structure |
C. | a is a structure and b is a pointer to a structure |
D. | a is a pointer to a structure and b is a structure |
Answer» A. a is a pointer to a structure in which b is a field |
127. | How many bits are absolutely necessary to store an ASCII character ? |
A. | 7 |
B. | 8 |
C. | 15 |
D. | 16 |
Answer» A. 7 |
128. | The result of 0001 1010 / 0001 0101 is |
A. | 0001 1111 |
B. | 1111 0001 |
C. | 0001 0000 |
D. | none of these |
Answer» A. 0001 1111 |
129. | The result of 0001 1010 & 0000 1000 is ___ |
A. | 0001 1111 |
B. | 1111 0001 |
C. | 0000 1000 |
D. | none of these |
Answer» C. 0000 1000 |
130. | The result of 0001 1010 ~ 0100 0011 is |
A. | 0101 1001 |
B. | 1010 0100 |
C. | 0000 0010 |
D. | none of these |
Answer» B. 1010 0100 |
131. | The result of 0001 1010^0001 0000 is____ |
A. | 0101 1001 |
B. | 1010 0100 |
C. | 0000 0010 |
D. | none of these |
Answer» C. 0000 0010 |
132. | The result of 0001 1010 << 2 is____ |
A. | 0101 1100 |
B. | 0110 1000 |
C. | 0001 1110 |
D. | none of these |
Answer» B. 0110 1000 |
133. | The result of 0001 1010 >>2 is____ |
A. | 0101 1100 |
B. | 0010 1110 |
C. | 0000 0110 |
D. | none of these |
Answer» C. 0000 0110 |
134. | The most significant bit is lost in following operation |
A. | << |
B. | >> |
C. | & |
D. | / |
Answer» A. << |
135. | The result of i)true AND false II)false or false |
A. | i)is true and ii)is true |
B. | i)is true and ii)is false |
C. | i)is false and ii)is true |
D. | i)is false and ii)is false |
Answer» D. i)is false and ii)is false |
136. | What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int i=320; char *ptr=(char *)&i; printf(“%d”,*ptr); return 0; } |
A. | 320 |
B. | 1 |
C. | 64 |
D. | none of the above |
Answer» C. 64 |
137. | What will be output if you will compile and execute the following c code? #include<stdio.h> #define x 5+2 int main(){ int i; i=x*x*x; printf(“%d”,i); return 0; } |
A. | 343 |
B. | 27 |
C. | 133 |
D. | compiler error |
Answer» B. 27 |
138. | 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; } |
A. | 135 |
B. | +inf |
C. | -121 |
D. | -8 |
Answer» C. -121 |
139. | What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ float a=5.2; if(a==5.2) printf(“Equal”); else if(a<5.2) printf(“Less than”); else printf(“Greater than”); return 0; } |
A. | equal |
B. | less than |
C. | greater than |
D. | compiler error |
Answer» B. less than |
140. | 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; } |
A. | 21 |
B. | 18 |
C. | 12 |
D. | compiler error |
Answer» A. 21 |
141. | 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; } |
A. | it will print nothing |
B. | -3 |
C. | -2 |
D. | compiler error |
Answer» D. compiler error |
142. | What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int a=10; printf(“%d %d %d”,a,a++,++a); return 0; } |
A. | 12 11 11 |
B. | 12 10 10 |
C. | 11 11 12 |
D. | 10 10 12 |
Answer» A. 12 11 11 |
143. | What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ char *str=”Hello world”; printf(“%d”,printf(“%s”,str)); return 0; } |
A. | 10hello world |
B. | 11hello world |
C. | hello world12 |
D. | hello world13 |
Answer» D. hello world13 |
144. | What will be output if you will compile and execute the following c code? #include <stdio.h> #include <string.h> int main(){ char *str=NULL; strcpy(str,”cquestionbank”); printf(“%s”,str); return 0; } |
A. | cquestionbank |
B. | cquestionbank\\0 |
C. | (null) |
D. | it will print nothing |
Answer» C. (null) |
145. | #include <stdio.h> #include <string.h> int main(){ int i=0; for(;i<=2;) printf(” %d”,++i); return 0; } |
A. | 0 1 2 3 |
B. | 0 1 2 |
C. | 1 2 3 |
D. | compiler error |
Answer» C. 1 2 3 |
146. | What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int x; for(x=1;x<=5;x++); printf(“%d”,x); return 0; } |
A. | 4 |
B. | 5 |
C. | 6 |
D. | compiler error |
Answer» C. 6 |
147. | What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ printf(“%d”,sizeof(5.2)); return 0; } |
A. | 2 |
B. | 4 |
C. | 8 |
D. | 10 |
Answer» C. 8 |
148. | What will be output if you will compile and execute the following c code? #include <stdio.h> #include <string.h> int main(){ char c=’\08′; printf(“%d”,c); return 0; } |
A. | 8 |
B. | \8\ |
C. | 9 |
D. | compiler error |
Answer» D. compiler error |
149. | What will be output if you will compile and execute the following c code? #include<stdio.h> #define call(x,y) x##y int main(){ int x=5,y=10,xy=20; printf(“%d”,xy+call(x,y)); return 0; } |
A. | 35 |
B. | 510 |
C. | 15 |
D. | 40 |
Answer» D. 40 |
151. | What is error in following declaration? struct outer{ int a; struct inner{ char c; }; }; |
A. | nesting of structure is not allowed in c |
B. | it is necessary to initialize the member variable |
C. | inner structure must have name |
D. | outer structure must have name |
Answer» C. inner structure must have name |
152. | 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; } |
A. | -60 |
B. | -30 |
C. | 60 |
D. | garbage value |
Answer» B. -30 |
153. | 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; } |
A. | equal |
B. | less than |
C. | greater than |
D. | compiler error |
Answer» D. compiler error |
154. | 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; } |
A. | 5 |
B. | 6 |
C. | 7 |
D. | 0 |
Answer» D. 0 |
155. | 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; } |
A. | 12 |
B. | 8 |
C. | 4 |
D. | 1 |
Answer» A. 12 |
156. | C language was invented by |
A. | abacus |
B. | charles babage |
C. | thomson |
D. | dennis ritchie |
Answer» D. dennis ritchie |
157. | The data type created by the data abstraction process is called |
A. | class |
B. | structure |
C. | abstract data type |
D. | user defined data type |
Answer» C. abstract data type |
158. | A variable which is visible only in the function in which it is defined, is called |
A. | static |
B. | auto |
C. | external |
D. | local |
Answer» D. local |
159. | Unsigned integers occupies |
A. | two bytes |
B. | four bytes |
C. | one bytes |
D. | eight bytes |
Answer» C. one bytes |
160. | Which of the following data structure is linear type ? |
A. | strings |
B. | lists |
C. | queues |
D. | all of the above |
Answer» D. all of the above |
161. | 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 |
Answer» C. base address of the array |
162. | Which data structure allows deleting data elements from front and inserting at rear? |
A. | stack |
B. | queue |
C. | dequeue |
D. | binary search tree |
Answer» B. queue |
163. | Queue is a ————– List . |
A. | fifo |
B. | lifo |
C. | lilo |
D. | liso |
Answer» A. fifo |
164. | Stack is a ————-List. |
A. | lifo |
B. | fifo |
C. | lilo |
D. | lito |
Answer» A. lifo |
165. | A node in a linked list must contain at least |
A. | three fields |
B. | two fields |
C. | four fields |
D. | one field |
Answer» B. two fields |
166. | An algorithm is made up of two independent time complexities f (n) and g (n). Then the complexities of the algorithm is in the order of |
A. | f(n) x g(n) |
B. | max ( f(n),g(n)) |
C. | min (f(n),g(n)) |
D. | f(n) + g(n) |
Answer» B. max ( f(n),g(n)) |
167. | Big O notation is defined for |
A. | time and space complexity |
B. | optimality |
C. | seaching |
D. | none of the above |
Answer» A. time and space complexity |
168. | Consider that n elements are to be sorted. What is the worst case time complexity of Bubble sort? |
A. | o(1) |
B. | o(log2n) |
C. | o(n) |
D. | o(n^2) |
Answer» D. o(n^2) |
169. | The complexity of Binary search algorithm is |
A. | o(n) |
B. | o(log n) |
C. | o(n2) |
D. | o(n log n) |
Answer» B. o(log n) |
170. | The complexity of linear search algorithm is |
A. | o(n) |
B. | o(log n) |
C. | o(n2) |
D. | o(n log n) |
Answer» A. o(n) |
171. | Which of the following data structure is linear data structure? |
A. | trees |
B. | graphs |
C. | arrays |
D. | none of above |
Answer» C. arrays |
172. | What is the maximun number of dimensions an array in C may have? |
A. | two |
B. | eight |
C. | twenty |
D. | theoratically no limit. the only practical limits are memory size and compilers |
Answer» D. theoratically no limit. the only practical limits are memory size and compilers |
173. | An external variable |
A. | is globally accessible by all functions |
B. | has a declaration |
C. | will be initialized to 0 if not initialized |
D. | all of these |
Answer» D. all of these |
174. | The declaration “unsigned u” indicates u is a/an |
A. | unsigned character |
B. | unsigned integer |
C. | character |
D. | none of\ these |
Answer» B. unsigned integer |
176. | Which of the following ‘C’ type is not a primitive data structure? |
A. | int |
B. | float |
C. | char |
D. | none of these |
Answer» D. none of these |
177. | The program fragment int i = 263 ; putchar (i) ; prints |
A. | 263 |
B. | ascii equivalent of 263 |
C. | rings the bell |
D. | garbage |
Answer» C. rings the bell |
178. | The variables which can be accessed by all modules in a program, are called |
A. | local variables |
B. | internal variables |
C. | external variable |
D. | global variables |
Answer» D. global variables |
179. | The main measures of efficiency of an algorithm are |
A. | processor and memory |
B. | complexity and capacity |
C. | time and space |
D. | data and space |
Answer» C. time and space |
180. | The worst case occures in linear search algorithms when |
A. | item is somewhere in the middle of the array |
B. | item is not there in the array at all |
C. | item is last element in the array |
D. | item is last element in the array or is not there at all. |
Answer» D. item is last element in the array or is not there at all. |
181. | the terms push and pop are related to |
A. | stack |
B. | queue |
C. | array |
D. | none of the above |
Answer» A. stack |
182. | What will be the output of the program? #include<stdio.h> int main() { int X=40; { int X=20; printf(“%d “, X); } printf(“%d\n”, X); return 0; } |
A. | 40 40 |
B. | 20 20 |
C. | 20 |
D. | error |
Answer» D. error |
183. | What additional requirement is placed on an array, so that binary search may be used to locate an entry? |
A. | the array elements must form a heap |
B. | the array must have at least 2 entries. |
C. | the array must be sorted. |
D. | the array\s size must be a power of two. |
Answer» C. the array must be sorted. |
184. | One difference between a queue and a stack is: |
A. | queues require dynamic memory, but stacks do not. |
B. | stacks require dynamic memory, but queues do not |
C. | queues use two ends of the structure; stacks use only one. |
D. | stacks use two ends of the structure, queues use only one. |
Answer» C. queues use two ends of the structure; stacks use only one. |
185. | 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? |
A. | abcd |
B. | abdc |
C. | dcab |
D. | dcba |
Answer» D. dcba |
186. | Which of the following formulas in big-O notation best represent the expression n²+35n+6? |
A. | o(n³) |
B. | o(n²) |
C. | o(n) |
D. | o(42) |
Answer» B. o(n²) |
187. | What term is used to describe an O(n) algorithm |
A. | constant |
B. | linear |
C. | logarithmic |
D. | quadratic |
Answer» B. linear |
188. | The keyword used to transfer control from a function back to the calling function is |
A. | switch |
B. | goto |
C. | go back |
D. | return |
Answer» D. return |
189. | How many times the program will print “Amrutvahini” ? #include<stdio.h> int main() { printf(“Amrutvahini”); main(); return 0; } |
A. | infinite times |
B. | 32767 times |
C. | 65535 times |
D. | till stack overflows |
Answer» D. till stack overflows |
190. | What will be the output of the program? #include<stdio.h> int i; int fun(); int main() { while(i) { fun(); main(); } printf(“Hello\n”); return 0; } int fun() { printf(“Hi”); } |
A. | hello |
B. | hi hello |
C. | no output |
D. | infinite loop |
Answer» A. hello |
191. | In a linked list, the pointer of the last node contains a special value, called the ______ pointer. |
A. | null |
B. | zero |
C. | link |
D. | next pointer |
Answer» A. null |
192. | In a ________ linked list, the last node’s link field points to the first node of the list. |
A. | circularly |
B. | linearly |
C. | sequentially |
D. | indexed |
Answer» A. circularly |
193. | The second part of the node, is called _______ field, and contains the address of the next node in the list. |
A. | pointer |
B. | field |
C. | node |
D. | link |
Answer» D. link |
194. | The link list also contains a list pointer variable called start or ________. |
A. | name |
B. | field |
C. | node |
D. | link |
Answer» A. name |
195. | A ________ linked list is a linked list structure in which each node has a pointer to both its successor and predecessor. |
A. | circularly |
B. | doubly |
C. | linear |
D. | sequential |
Answer» B. doubly |
196. | _______ list is a special list that is maintained, which consists of unused memory cells. |
A. | linear |
B. | doubly linked |
C. | circularly linked |
D. | free storage |
Answer» D. free storage |
197. | _______ is a technique using which a computer periodically collects all the deleted space onto the free storage list. |
A. | garbage collection |
B. | garbage compaction |
C. | linked list |
D. | free storage |
Answer» A. garbage collection |
198. | _______ attacks the problem of fragmentation by moving all the allocated blocks to one end of memory, thus combining all the holes. |
A. | underflow |
B. | overflow |
C. | compaction |
D. | free storage |
Answer» B. overflow |
199. | A ________ linked list is a linked list which always contains a special node, called the header node. |
A. | circular |
B. | grounded |
C. | header |
D. | doubly |
Answer» C. header |
201. | _______ refers to situation where one wants to delete data form a data structure that is empty. | |
A. | free storage | |
B. | underflow | |
C. | overflow | |
D. | compaction | |
Answer» B. underflow | ||
202. | ________ is an organization that provides faster request and return time response. |
A. | stack |
B. | queue |
C. | buddy system |
D. | recursion |
Answer» C. buddy system |
203. | _______ attacks the problem of fragmentation by moving all the allocated blocks to one end of memory, thus combining all the holes. |
A. | garbage collection |
B. | garbage compaction |
C. | buddy system |
D. | queue |
Answer» B. garbage compaction |
204. | 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. |
A. | one way |
B. | linear array |
C. | two way |
D. | header |
Answer» C. two way |
205. | _________ header list combines the advantages of a two-way list and a circular header list. |
A. | one way |
B. | two way circular |
C. | two way |
D. | header |
Answer» B. two way circular |
206. | In linked list,a node contain |
A. | node,adrees field and data field |
B. | node number and data field |
C. | next adress field and information field |
D. | none of the above |
Answer» C. next adress field and information field |
207. | In linked list,the logical order of elements |
A. | is same as their physical arrangement |
B. | is not necessarily equivalent to their physical arrangement |
C. | is determined by their physical arrangement |
D. | none of the above |
Answer» B. is not necessarily equivalent to their physical arrangement |
208. | Null pointer is used to tell |
A. | end of linked list |
B. | empty pointer field of a structure |
C. | the linked list is empty |
D. | all of the above |
Answer» D. all of the above |
209. | List pointer variable in linked list contains address of the |
A. | following node in the first |
B. | current node in the first |
C. | first node in the first |
D. | none of the above |
Answer» C. first node in the first |
210. | Because of linear structure of linked list having linear ordering,there is similarity between linked list and array in |
A. | insertion of a node |
B. | deletion of a node |
C. | traversal of elements of list |
D. | none of the above |
Answer» C. traversal of elements of list |
211. | Searching of linked list requires linked list to be created |
A. | in stored order only |
B. | in any order |
C. | without underflow condition |
D. | none of the above |
Answer» B. in any order |
212. | A circular list can be used to represent |
A. | a stack |
B. | a queue |
C. | a tree |
D. | both a and b |
Answer» D. both a and b |
213. | To insert a node in a circular list at rear end it should be inserted at ……of the queue |
A. | front position |
B. | front-1position |
C. | rear position |
D. | rear-1 position |
Answer» C. rear position |
214. | In a circularly linked list organisation ,insertion of a record involves the modifications of |
A. | no pointer |
B. | 1 pointer |
C. | 2 pointer |
D. | 3 pointer |
Answer» B. 1 pointer |
215. | What is true about linked kist? |
A. | it is a linked structure,where each data gives the address of the next data |
B. | it is a dynamic data structure |
C. | it is a static data structure |
D. | both (a) and (b) |
Answer» A. it is a linked structure,where each data gives the address of the next data |
216. | A node of linked list contains_______ |
A. | data field |
B. | a self referential pointer |
C. | both (a)and(b) |
D. | only b |
Answer» C. both (a)and(b) |
217. | Which nodes contains a null pointer in a linked list? |
A. | first node |
B. | middle node |
C. | last node |
D. | both (a) and (b) |
Answer» C. last node |
218. | Deletion of a node from an empty linked list will cause________ |
A. | underflow |
B. | overflow |
C. | run time error |
D. | all of the above |
Answer» A. underflow |
219. | Insertion in a linked list requires modification of____pointers |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» B. 2 |
220. | Deletion in a linked list requeries modification of______pointers |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» A. 1 |
221. | Accessing time of nth node in a linked list is______ |
A. | 0(n) |
B. | 0(1) |
C. | 0(n2) |
D. | 0(log n) |
Answer» A. 0(n) |
222. | An array is referenced by its name.Similarly,a linked list is referenced by____ |
A. | address of the first node |
B. | address of the last node |
C. | both (a)and(b) |
D. | none of these |
Answer» A. address of the first node |
223. | Time required to search an element in a linked list is____ |
A. | 0(n) |
B. | 0(log n) |
C. | 0(n2) |
D. | 0(n log n) |
Answer» A. 0(n) |
224. | Time required to search an element in a sorted linked list is______ |
A. | 0(n) |
B. | 0(log n) |
C. | o(n2) |
D. | 0(n log n) |
Answer» A. 0(n) |
226. | Select the set of instructions to insert a node pointed by q after a node pointed by p |
A. | q->next=p->next; p->next=q; |
B. | p->next=q; q->next=p->next |
C. | both (a)and(b) |
D. | none of these |
Answer» A. q->next=p->next; p->next=q; |
227. | select the set of operations to insert a node pointed by q at the beginning of the linked list |
A. | q->next=head; head=q; |
B. | head=q;q ->next=head; |
C. | both (a)and(b) |
D. | none of these |
Answer» A. q->next=head; head=q; |
228. | Select the set of operations to delete the first node from a linked list |
A. | p=head;head=head->next;free(p); |
B. | free(head) |
C. | head=head->next;p=head;free(p) |
D. | none of these |
Answer» A. p=head;head=head->next;free(p); |
229. | Select the correct looping condition for positioning apointer p on the second last in a linked list.Assume p=head,initially. |
A. | p->next->next!=null |
B. | p->next=null |
C. | p!=null |
D. | none of these |
Answer» A. p->next->next!=null |
230. | If address of the 8th element in a linked list of integers is1022,then address of the 9th element is |
A. | 1024 |
B. | 1026 |
C. | 1023 |
D. | unknown |
Answer» D. unknown |
231. | The advantages of linked list over an array for representing a list is________ |
A. | space used is less |
B. | deletion is easier |
C. | insertion is easier |
D. | both (a) and (b) |
Answer» D. both (a) and (b) |
232. | The address returned by malloc()is type casted because |
A. | malloc returns integers pointer |
B. | malloc returns void pointer |
C. | malloc returns an integer value |
D. | none of these |
Answer» B. malloc returns void pointer |
233. | Which function returns a void pointers? |
A. | malloc returns integers pointer |
B. | calloc |
C. | both (a)and(b) |
D. | none of these |
Answer» C. both (a)and(b) |
234. | Select the correct statement |
A. | free is used to release memory allocated by malloc |
B. | free is used to release memory allocated by calloc |
C. | both (a)and(b) |
D. | only(a)but not(b) |
Answer» C. both (a)and(b) |
235. | The____linked list can be processed in either direction. |
A. | singly |
B. | singly circular |
C. | doublyly |
D. | none of these |
Answer» C. doublyly |
236. | A polynominal in single variable should be handled using__ |
A. | an array of structure |
B. | singly linked list |
C. | gll |
D. | both (a) and (b) |
Answer» D. both (a) and (b) |
237. | A node of doubly linked contains |
A. | pointer to predecessor |
B. | pointer to sucessor |
C. | both (a)and(b) |
D. | only(a) |
Answer» C. both (a)and(b) |
238. | Each node in a linear list contains an item called____which points to the next node in the list. |
A. | node |
B. | link |
C. | variable |
D. | null |
Answer» B. link |
239. | Which is not dynamic memory allocation function? |
A. | malloc returns integers pointer |
B. | calloc |
C. | alloc |
D. | free |
Answer» C. alloc |
240. | The function that allocates requested size of bytes and returns a pointer to the first byte of the allocated space is |
A. | realloc |
B. | malloc |
C. | free |
D. | none of these |
Answer» B. malloc |
241. | NULL link is not present in… |
A. | singly linked list |
B. | doubly linked list |
C. | circular linked list |
D. | none of these |
Answer» C. circular linked list |
242. | In a circular linked list |
A. | components are all linked together in some sequential manner. |
B. | there is no beginning and no end. |
C. | components are arranged hierarchically. |
D. | forward and backward traversal within the list is permitted. |
Answer» B. there is no beginning and no end. |
243. | A linear collection of data elements where the linear node is given by means of pointer is called? |
A. | linked list |
B. | node list |
C. | primitive list |
D. | none |
Answer» A. linked list |
244. | Which of the following operations is performed more efficiently by doubly linked list than by singly linked list? |
A. | deleting a node whose location in given |
B. | searching of an unsorted list for a given item |
C. | inverting a node after the node with given location |
D. | traversing a list to process each node |
Answer» A. deleting a node whose location in given |
245. | Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head and tail pointer. Given the representation, which of the following operation can be implemented in O(1) time? i) Insertion at the front of the linked list ii) Insertion at the end of the linked list iii) Deletion of the front node of the linked list iv) Deletion of the last node of the linked lis |
A. | i and ii |
B. | i and iii |
C. | i,ii and iii |
D. | i,ii and iv |
Answer» C. i,ii and iii |
246. | Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head pointer only. Given the representation, which of the following operation can be implemented in O(1) time? i) Insertion at the front of the linked list ii) Insertion at the end of the linked list iii) Deletion of the front node of the linked list iv) Deletion of the last node of the linked list |
A. | i and ii |
B. | i and iii |
C. | i,ii and iii |
D. | i,ii and iv |
Answer» B. i and iii |
247. | Consider an implementation of unsorted doubly linked list. Suppose it has its representation with a head pointer and tail pointer. Given the representation, which of the following operation can be implemented in O(1) time? i) Insertion at the front of the linked list ii) Insertion at the end of the linked list iii) Deletion of the front node of the linked list iv) Deletion of the end node of the linked list |
A. | i and ii |
B. | i and iii |
C. | i,ii and iii |
D. | i,ii,iii and iv |
Answer» D. i,ii,iii and iv |
248. | In linked list each node contain minimum of two fields. One field is data field to store the data second field is? |
A. | pointer to character |
B. | pointer to integer |
C. | pointer to node |
D. | node |
Answer» C. pointer to node |
249. | What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list? |
A. | o(1) |
B. | o(n) |
C. | θ (n) |
D. | θ (1) |
Answer» C. θ (n) |
251. | What would be the asymptotic time complexity to find an element in the linked list? |
A. | o(1) |
B. | o(n) |
C. | o(n2) |
D. | none |
Answer» B. o(n) |
252. | What would be the asymptotic time complexity to insert an element at the second position in the linked list? |
A. | o(1) |
B. | o(n) |
C. | o(n2) |
D. | none |
Answer» A. o(1) |
253. | The concatenation of two list can performed in O(1) time. Which of the following variation of linked list can be used? |
A. | singly linked list |
B. | doubly linked list |
C. | circular doubly linked list |
D. | array implementation of list |
Answer» C. circular doubly linked list |
254. | Consider the following definition in c programming language struct node { int data; struct node * next; } typedef struct node NODE; NODE *ptr; Which of the following c code is used to create new node? |
A. | ptr=(node*)malloc(sizeof(node)); |
B. | ptr=(node*)malloc(node); |
C. | ptr=(node*)malloc(sizeof(node*)); |
D. | ptr=(node)malloc(sizeof(node)); |
Answer» A. ptr=(node*)malloc(sizeof(node)); |
255. | A variant of linked list in which last node of the list points to the first node of the list is? |
A. | singly linked list |
B. | doubly linked list |
C. | circular linked list |
D. | multiply linked list |
Answer» C. circular linked list |
256. | In doubly linked lists, traversal can be performed? |
A. | only in forward direction |
B. | only in reverse direction |
C. | in both directions |
D. | none |
Answer» C. in both directions |
257. | What kind of linked list is best to answer question like “What is the item at position n?” |
A. | singly linked list |
B. | doubly linked list |
C. | circular linked list |
D. | array implementation of linked list |
Answer» D. array implementation of linked list |
258. | A variation of linked list is circular linked list, in which the last node in the list points to first node of the list. One problem with this type of list is? |
A. | it waste memory space since the pointer head already points to the first node and thus the list node does not need to point to the first node. |
B. | it is not possible to add a node at the end of the list. |
C. | it is difficult to traverse the list as the pointer of the last node is now not null |
D. | all of above |
Answer» C. it is difficult to traverse the list as the pointer of the last node is now not null |
259. | A variant of the linked list in which none of the node contains NULL pointer is? |
A. | singly linked list |
B. | doubly linked list |
C. | circular linked list |
D. | none |
Answer» C. circular linked list |
260. | In circular linked list, insertion of node requires modification of? |
A. | one pointer |
B. | two pointer |
C. | three pointer |
D. | none |
Answer» B. two pointer |
261. | Which of the following statements about linked list data structure is/are TRUE? |
A. | addition and deletion of an item to/ from the linked list require modification of the existing pointers |
B. | the linked list pointers do not provide an efficient way to search an item in the linked list |
C. | linked list pointers always maintain the list in ascending order |
D. | the linked list data structure provides an efficient way to find kth element in the list |
Answer» B. the linked list pointers do not provide an efficient way to search an item in the linked list |
262. | Linked lists are not suitable to for the implementation of? |
A. | insertion sort |
B. | radix sort |
C. | polynomial manipulation |
D. | binary search |
Answer» D. binary search |
263. | In worst case, the number of comparison need to search a singly linked list of length n for a given element is |
A. | log n |
B. | n/2 |
C. | log2n-1 |
D. | n |
Answer» D. n |
264. | consider the function f defined here: struct item { int data; struct item * next; }; int f (struct item *p) { return((p==NULL) ||((p->next==NULL)||(p->data<=p->next->data) && (p->next))); } For a given linked list p, the function f returns 1 if and only if |
A. | the list is empty or has exactly one element |
B. | the element in the list are sorted in non-decreasing order of data value |
C. | the element in the list are sorted in non-increasing order of data value |
D. | not all element in the list have the same data value |
Answer» B. the element in the list are sorted in non-decreasing order of data value |
265. | Finite sequence S of Zero or more chatacters is called_____ |
A. | array |
B. | list |
C. | string |
D. | block |
Answer» C. string |
266. | String with zero characters is called____string |
A. | null |
B. | binary |
C. | totalled |
D. | list |
Answer» A. null |
267. | Groups of consecutive element in a string.Such as words,phrase and sentences are called___ |
A. | main string |
B. | substring |
C. | index |
D. | block |
Answer» B. substring |
268. | _____operation of word processing invovles replacing one string in the text by another. |
A. | insertion |
B. | deletion is easier |
C. | searching |
D. | replacement |
Answer» D. replacement |
269. | _____is the problem of deciding whether or not a given string problem p appears in a text T. |
A. | pattern matching |
B. | searching |
C. | sorting |
D. | deletion |
Answer» A. pattern matching |
270. | If string1=john,and string2=Rivers are merged,the process is called |
A. | insertion |
B. | deletion |
C. | concatenation |
D. | replacement |
Answer» C. concatenation |
271. | ____is a variable whose length may vary during the execution of a program. |
A. | dynamic |
B. | static |
C. | semistatistic |
D. | global |
Answer» A. dynamic |
272. | NurseryLand.Nursery.Students = 10; |
A. | the structure students is nested within the structure nursery |
B. | the structure nurseryland is nested within the structure nursery. |
C. | the structure nursery is nested within the structure nurseryland. |
D. | the structure nursery is nested within the structure students |
Answer» C. the structure nursery is nested within the structure nurseryland. |
273. | If a function is declared as void fn(int *p), then which of the following statements is valid to call function fn? |
A. | fn(x) where x is defined as int x; |
B. | fn(x) where x is defined as int *x; |
C. | fn(&x) where x is defined as int *x; |
D. | fn(*x) where x is defined as int *x; |
Answer» B. fn(x) where x is defined as int *x; |
274. | To declare an array S that holds a 5-character string, you would write |
A. | char s[5] |
B. | char s[6] |
C. | string s[5] |
D. | stringchar s[5] |
Answer» A. char s[5] |
276. | A structure definition is called as | |
A. | template | |
B. | member | |
C. | both 1 & 2 | |
D. | none of these | |
Answer» A. template | ||
277. | If a, b and c are integer variables with the values a=8, b=3 and c=-5. Then what is the value of the arithmetic expression: 2 * b + 3 * (a-c) |
A. | 15 |
B. | 6 |
C. | -16 |
D. | -1 |
Answer» A. 15 |
278. | A global variable is a variable |
A. | declared in the main ( ) function |
B. | declared in any function other than the main ( ) function |
C. | declared outside the body of every function. |
D. | declared any where in the c program. |
Answer» C. declared outside the body of every function. |
279. | main ( ) is an example of |
A. | library function |
B. | user defined function |
C. | header |
D. | statement |
Answer» A. library function |
280. | While incrementing a pointer, its value gets increased by the length of the data type to which it points. This length is called |
A. | scale factor |
B. | length factor |
C. | pointer factor |
D. | increment factor |
Answer» A. scale factor |
281. | a->b is systematically correct if_____ |
A. | a is a npointer to a structure in which b is a field |
B. | a and b are structure |
C. | a is a structure and b is a pointer to a structure |
D. | a is a pointer to a structure and b is a structure |
Answer» A. a is a npointer to a structure in which b is a field |
282. | Which of the following best describes sorting ? |
A. | accessing and processing each record exactly once |
B. | finding the location of the record with a given key |
C. | arranging the data (record) in some given order |
D. | adding a new record to the data structure |
Answer» C. arranging the data (record) in some given order |
283. | A function which calls itself is called as |
A. | library function |
B. | directive |
C. | recursive function |
D. | none of above |
Answer» C. recursive function |
284. | Where do we use the operator -> ? |
A. | to access a member of structure |
B. | to access member of union |
C. | to access an array |
D. | both(a) and(b). |
Answer» D. both(a) and(b). |
285. | In selection sort of n elements,how many times is the swap function called in the complete execution of the algorithm? |
A. | 1 |
B. | n-1 |
C. | n(n-1)/2 |
D. | none of these |
Answer» B. n-1 |
286. | a->b is systematically correct if_____ |
A. | a is a pointer to a structure in which b is a field |
B. | a and b are structure |
C. | a is a structure and b is a pointer to a structure |
D. | a is a pointer to a structure and b is a structure |
Answer» A. a is a pointer to a structure in which b is a field |
287. | Literal means |
A. | string |
B. | string constant |
C. | character |
D. | alphabet |
Answer» B. string constant |
288. | Each data item in a record may be a group item composed of sub-items; those items which are indecomposable are called |
A. | Elementary items |
B. | Atoms |
C. | Scalars |
D. | All of above |
Answer» D. All of above |
289. | Which of the following statement is false ? |
A. | Arrays are dense lists and static data structure |
B. | Data elements in linked list need not be stored in adjacent space in memory |
C. | Pointers store the next data element of a list |
D. | Linked lists are collection of the nodes that contain information part and next pointer |
Answer» C. Pointers store the next data element of a list |
290. | Binary search algorithm cannot be applied to |
A. | Sorted binary trees |
B. | Sorted linear array |
C. | Pointer array |
D. | Sorted linked list |
Answer» D. Sorted linked list |
291. | When new data are to be inserted into a data structure, but there is no available space; this situation is usually called |
A. | Housefull |
B. | Saturated |
C. | Underflow |
D. | Overflow |
Answer» D. Overflow |
292. | The situation when in a linked list START=NULL is |
A. | Underflow |
B. | Overflow |
C. | Housefull |
D. | Saturated |
Answer» A. Underflow |
293. | The following is two-way list |
A. | Grounded header list |
B. | Circular header list |
C. | Linked list with header and trailer nodes |
D. | None of above |
Answer» D. None of above |
294. | The following name does not relate to stacks |
A. | FIFO lists |
B. | LIFO list |
C. | Piles |
D. | Push-down lists |
Answer» A. FIFO lists |
295. | In a binary tree, certain null entries are re- placed by special pointers which point to nodes higher in tree for efficiency. These special pointers are called |
A. | Leaf |
B. | Branch |
C. | Path |
D. | Thread |
Answer» D. Thread |
296. | In a graph if e=(u, v) means |
A. | e begins at u and ends at v |
B. | u is processor and v is successor |
C. | both B and C are true |
D. | none is true |
Answer» C. both B and C are true |
297. | If every node u in G is adjacent to every other node v in G, A graph is said to be |
A. | Isolated |
B. | Complete |
C. | Finite |
D. | Strongly connected |
Answer» B. Complete |
298. | A variable P is called pointer if |
A. | P points to the address of first element in DATA |
B. | P can store only memory addresses |
C. | P contain the DATA and the address of DATA |
D. | P contains the address of an element in DATA. |
Answer» D. P contains the address of an element in DATA. |
299. | The Worst case occur in linear search algo- rithm when |
A. | Item is not in the array at all |
B. | Item is the last element in the array |
C. | Item is the last element in the array or is not there at all |
D. | None of above |
Answer» C. Item is the last element in the array or is not there at all |
301. | The complexity of the average case of an algorithm is |
A. | Much more complicated to analyze than that of worst case |
B. | Much more simpler to analyze than that of worst case |
C. | Sometimes more complicated and some other times simpler than that of worst case |
D. | None of the above |
Answer» A. Much more complicated to analyze than that of worst case |
302. | The following data structure allows deleting data elements from front and inserting at rear |
A. | Stacks |
B. | Queues |
C. | Deques |
D. | Binary search tree |
Answer» B. Queues |
303. | This data structure allows deletions at both ends of the list but insertion at only one end. |
A. | Input-restricted deque |
B. | Output-restricted deque |
C. | Priority queues |
D. | None of the above |
Answer» A. Input-restricted deque |
304. | The following data structure is non-linear type |
A. | Strings |
B. | Lists |
C. | Stacks |
D. | None of the above |
Answer» D. None of the above |
305. | The following data structure is linear type |
A. | Strings |
B. | Lists |
C. | Queues |
D. | All of the above |
Answer» D. All of the above |
306. | To represent hierarchical relationship be- tween elements, the following data structure is not suitable |
A. | Deque |
B. | Priority |
C. | Tree |
D. | All of above |
Answer» C. Tree |
307. | A binary tree whose every node has either zero or two children is called |
A. | Complete binary tree |
B. | Binary search tree |
C. | Extended binary tree |
D. | None of above |
Answer» C. Extended binary tree |
308. | The depth of a complete binary tree is given by |
A. | Dn = n log2n |
B. | Dn = n log2n+1 |
C. | Dn = log2n |
D. | Dn = log2n+1 |
Answer» D. Dn = log2n+1 |
309. | The complexity of Binary search algorithm is |
A. | O(n) |
B. | O(log ) |
C. | O(n log n) |
D. | None of the above |
Answer» B. O(log ) |
310. | The complexity of Bubble sort algorithm is |
A. | O(n) |
B. | O (n2) |
C. | O(n log n) |
D. | None of the above |
Answer» B. O (n2) |
311. | When in order traversing a tree resulted E A C K F H D B G; the preorder traversal would return |
A. | FAEKCDBHG |
B. | FAEKCDHGB |
C. | EAFKHDCBG |
D. | FEAKDCHBG |
Answer» B. FAEKCDHGB |
312. | When representing any algebraic expression E the following uses only binary operations in a 2-tree |
A. | the variable in E will appear as external nodes and operations in internal nodes |
B. | the operations in E will appear as exter- nal nodes and variables in internal nodes |
C. | the variables and operations in E will appear only in internal nodes |
D. | None of the above |
Answer» A. the variable in E will appear as external nodes and operations in internal nodes |
313. | When converting binary tree into extended binary tree, all the original nodes in binary tree are |
A. | internal nodes on extended tree |
B. | external nodes on extended tree |
C. | vanished on extended tree |
D. | None of the above |
Answer» A. internal nodes on extended tree |
314. | The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal |
A. | ABFCDE |
B. | ADBFEC |
C. | ABDECF |
D. | None of the above |
Answer» C. ABDECF |
315. | Which of the following data structure is lin- ear data structure? |
A. | Trees |
B. | Graphs |
C. | Arrays |
D. | None of the above |
Answer» C. Arrays |
316. | The operation of processing each element in the list is known as |
A. | Merging |
B. | Inserting |
C. | Traversal |
D. | All the above |
Answer» C. Traversal |
317. | Finding the location of the element with a given value is called |
A. | Traversal |
B. | Search |
C. | Sort |
D. | All of the above |
Answer» B. Search |
318. | Arrays are best data structures for |
A. | relatively permanent collections of data |
B. | the size of the structure and the data in the structure are constantly changing |
C. | both of above situation |
D. | none of above situation |
Answer» A. relatively permanent collections of data |
319. | Linked lists are best suited for |
A. | relatively permanent collections of data |
B. | the size of the structure and the data in the structure are constantly changing |
C. | both of above situation |
D. | none of above situation |
Answer» B. the size of the structure and the data in the structure are constantly changing |
320. | Each array declaration need not give, implicitly or explicitly, the information about the |
A. | name of array |
B. | data type of array |
C. | first data from the set to be stored |
D. | index set of the array |
Answer» C. first data from the set to be stored |
321. | The complexity of merge sort algorithm is |
A. | O(n) |
B. | O(log n) |
C. | O(n log n) |
D. | None of these |
Answer» C. O(n log n) |
322. | The indirect change of the values of a vari- able in one module by another module is called |
A. | internal change |
B. | inter-module change |
C. | side effect |
D. | all the above |
Answer» C. side effect |
323. | Two main measures for the efficiency of an algorithm are |
A. | Time and space |
B. | Processor and memory |
C. | Complexity and capacity |
D. | Data and space |
Answer» A. Time and space |
324. | The time factor when determining the effi- ciency of algorithm is measured by |
A. | Counting the number of key operations |
B. | Counting the number of statements |
C. | Counting the kilobytes of algorithm |
D. | None of the above |
Answer» A. Counting the number of key operations |
326. | All the above* Which of the following data structures are indexed structures | |
A. | linear arrays | |
B. | linked lists | |
C. | both of above | |
D. | none of above | |
Answer» A. linear arrays | ||
327. | Which of the following is not the required condition for binary search algorithm |
A. | there must be mechanism to delete and/ or insert elements in list |
B. | the list must be sorted |
C. | there should be the direct access to the middle element in any sublist |
D. | none of the above |
Answer» A. there must be mechanism to delete and/ or insert elements in list |
328. | Which of the following is not a limitation of binary search algorithm ? |
A. | binary search algorithm is not efficient when the data elements are more than 1000. |
B. | must use a sorted array |
C. | requirement of sorted array is expen- sive when a lot of insertion and dele- tions are needed |
D. | there must be a mechanism to access middle element directly |
Answer» A. binary search algorithm is not efficient when the data elements are more than 1000. |
329. | Two dimensional arrays are also called |
A. | tables arrays |
B. | matrix arrays |
C. | both of the above |
D. | none of the above |
Answer» C. both of the above |
330. | The term “push” and “pop” is related to the |
A. | Array |
B. | Lists |
C. | stacks |
D. | all of above |
Answer» C. stacks |
331. | A data structure where elements can be added or removed at either end but not in the middle is referred as |
A. | Linked lists |
B. | Stacks |
C. | Queues |
D. | Deque |
Answer» D. Deque |
332. | The following sorting algorithm is of divide- and-conquer type |
A. | Bubble sort |
B. | Insertion sort |
C. | Quick sort |
D. | None of the above |
Answer» C. Quick sort | |
Explanation: Quick sort is a divide-and-conquer sorting algorithm that works by partitioning a list of items into two smaller lists and then sorting each of these lists recursively. It is an efficient and widely used algorithm, with an average case time complexity of O(n log n). Bubble sort and insertion sort are both comparison-based sorting algorithms, but they do not use the divide-and-conquer approach. Bubble sort works by repeatedly swapping adjacent elements that are out of order, while insertion sort works by iteratively inserting each element into its correct position in the sorted list. Both of these algorithms have a time complexity of O(n^2) in the worst case. |
333. | An algorithm that calls itself directly or indi- rectly is known as |
A. | Recursion |
B. | Polish notation |
C. | Traversal algorithm |
D. | None of the above |
Answer» A. Recursion |
334. | The elements of an array are stored suc- cessively in memory cells because |
A. | by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated |
B. | the architecture of computer memory does not allow arrays to store other than serially |
C. | A and B both false |
D. | A and B both true |
Answer» A. by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated |
335. | The memory address of the first element of an array is called |
A. | base address |
B. | floor address |
C. | foundation address |
D. | first address |
Answer» A. base address |
336. | The memory address of fifth element of an array can be calculated by the formula |
A. | LOC(Array[5])=Base(Array[5])+(5-lower boun(D), where w is the number of words per memory cell for the array |
B. | LOC(Array[5])=Base(Array[4])+(5-Upper boun(D), where w is the number of words per memory cell for the array |
C. | LOC(Array[5]=Base(Array)+w(5-lower bou |
D. | , where w is the number of words per memory cell for the array |
Answer» C. LOC(Array[5]=Base(Array)+w(5-lower bou |
337. | The following data structure can’t store the non-homogeneous data elements |
A. | Arrays |
B. | Records |
C. | Pointers |
D. | None of the above |
Answer» A. Arrays |
338. | The in order traversal of tree will yield a sorted listing of elements of tree in |
A. | Binary trees |
B. | Binary search trees |
C. | Heaps |
D. | None of above |
Answer» B. Binary search trees |
339. | In a Heap tree values in a node is greater than |
A. | every value in left sub tree and smaller than right sub tree |
B. | every value in children of it |
C. | Both of above conditions are true |
D. | None of above conditions are true |
Answer» B. every value in children of it |
340. | In a graph if e=[u, v], Then u and v are called |
A. | endpoints of e |
B. | adjacent nodes |
C. | neighbors |
D. | all of the above |
Answer» D. all of the above |
341. | A connected graph T without any cycles is called |
A. | tree graph |
B. | free tree |
C. | tree |
D. | All of the above |
Answer» D. All of the above |
342. | The difference between linear array and a record is |
A. | An array is suitable for homogeneous data but hte data items in a record may have different data type |
B. | In a record, there may not be a natural ordering in opposed to linear array. |
C. | A record form a hierarchical structure but a linear array does not |
D. | All of above |
Answer» D. All of above |
343. | The following data structure store the ho- mogeneous data elements |
A. | Arrays |
B. | Records |
C. | Pointers |
D. | None of the above |
Answer» B. Records |
344. | Which of the following data structure is not linear data structure? |
A. | Arrays |
B. | Linked lists |
C. | A and B are true |
D. | None is true |
Answer» C. A and B are true |
Tags
Question and answers in Data Structure and Algorithms (DSA),Data Structure and Algorithms (DSA) multiple choice questions and answers,Data Structure and Algorithms (DSA) Important MCQs,Solved MCQs for Data Structure and Algorithms (DSA),Data Structure and Algorithms (DSA) MCQs with answers PDF download