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

From 256 to 270 of 305

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

a. int

b. float

c. char

d. none of these

  • d. none of these

Q. The program fragmentint i = 263 ;putchar (i) ;prints

a. 263

b. ascii equivalent of 263

c. rings the bell

d. garbage

  • c. rings the bell

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

  • d. global variables

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

  • c. time and space

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

  • d. item is last element in the array or is not there at all.

Q. the terms push and pop are related to

a. stack

b. queue

c. array

d. none of the above

  • a. stack

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

  • c. the array must be sorted.

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

  • c. queues use two ends of the structure; stacks use only one.

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

a. constant

b. linear

c. logarithmic

d. quadratic

  • b. linear

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

  • d. till stack overflows
Subscribe Now

Get All Updates & News