Top 350+ Solved Data Structure and Algorithms (DSA) MCQ Questions Answer

From 196 to 210 of 305

Q. Which of the following data structure can't store the non-homogeneous data element?

a. arrays

b. records

c. pointers

d. none

  • a. arrays

Q. 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

  • d. all of above

Q. 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"

  • a. s1="abcdef" and s2="def"

Q. 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

Q. 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).

  • d. both(a) and(b).

Q. The function strcmp(s1,s2)will return -1 if____

a. s1>s2

b. s1=s2

c. s1<s2

d. function does not return -1.

  • c. s1<s2

Q. Which of the following data structure store the homogeneous data elements?

a. arrays

b. records

c. pointers

d. none

  • b. records

Q. 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

  • b. preserves the original order of records with equal keys

Q. The average case complexity of Insertion Sort is

a. o(2n)

b. o(n3)

c. o(n2)

d. o(2n)

  • c. o(n2)

Q. 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

  • d. bubble sort
Subscribe Now

Get All Updates & News