• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Top MCQs on Data Structures and Algorithms

Question 1

Inserting an item into the stack when the stack is not full is called…….. Operation and deletion of an item from the stack, when the stack is not empty is called ...........operation.
 

  • push, pop

  • pop, push

  • insert, delete

  • delete, insert

Question 2

The Worst case occurs in linear search algorithm when

  • Item is somewhere in the middle of the array

  • Item is not in the array at all

  • Item is the last element in the array

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

Question 3

Within a switch statement, you can use—

  • Continue but not break

  • Break but not continue

  • Both continue and break

  • Neither continue nor break

Question 4

Which operator is used to invert all the digits in a binary representation of a number?

  • ~

  •  <<<

  • >>>

  • ^

Question 5

The Default Parameter passing mechanism is

  • Call by value

  • Call by reference

  • Call by value result

  • None of the above

Question 6

One IF statement can have multiple

  • IF

  •  ELSEIF

  • ELSE

  • CASE

Question 7

The program fragment—   

int a=5, b=2;
print(a++*++b);
  • Prints 15

  • Prints 10

  • Prints 18

  • None of these.

Question 8

Which is not the arithmetic operator in programming

  • %

  • >

  • *

  • +

Question 9

What will be the output of the following program?    

int a=5, b=2;
print ( a+++b);
  • Results in compilation error

  • Prints 7

  • Prints 8

  • None of above

Question 10

What happens if the base condition is not defined in recursion? 

  • Stack Underflow

  • Stack Overflow

  • None of these

  • Both a and b

There are 20 questions to complete.

Last Updated :
Take a part in the ongoing discussion