MCQ
Algorithms MCQ - Practice Questions with Answers
Solve 13 Algorithms questions for RAS/RPSC preparation.
Practice questions
Q1One term is wrong in the following series. Find that wrong term – 4, 15, 64, 5, 25, 125, 6, 36, 216
The intended pattern is groups of n, n squared, and n cubed for 4, 5, and 6. For 4 the middle term should be 4 squared = 16, while 64 is 4 cubed. The given 15 breaks the pattern, so option D is correct.
Q2The postfix form of the expression (A+B)*(C*D-E)*F/G , is -
Option C is correct because postfix places each operator after its operands. Here (A+B) becomes AB+, (C*D−E) becomes CD*E−, then multiplying by F and dividing by G gives AB+CD*E-*F*G/.
Q3Which one of the following is the process of inserting an element in the stack?
In a stack, the operation that places a new item on the top is called push. The verified programming reference for stack operations defines push as adding an item onto the top of the stack, while pop removes the top item. Therefore option C is correct.
Q4Reverse polish notation for infix expression (A+B)*C-D/E will be -
Reverse Polish notation is postfix notation, so every operator is written after its operands. Here, (A+B) becomes AB+, multiplying by C gives AB+C*, D/E becomes DE/, and subtracting the second part gives AB+C*DE/-. Therefore option D is the correct postfix form.
Q5Rohit multiplies a number by 2 instead of dividing the number by 2. Resultant number is what percentage of the correct value?
Option D is correct. If the number is x, the correct value after dividing by 2 is x/2, while Rohit's result is 2x; therefore the result is (2x)/(x/2) × 100 = 400% of the correct value.
You've seen 5 of 13 sample questions
Unlimited practice on Algorithms comes with the RAS Test Series + Practice pack or Gate Pass.
More questions
6What is the another name for the circular queue among the following options?
7For defining the best time complexity, let f(n) = log(n) and g(n) = √n, .......
8Which of the following principle does queue use?
9Consider an undirected un-weighted graph G. Let a breadth first traversal of G be done starting from a node r. Let d(r,u) and d(r,v) be the length of the shortest path from r to u and v respectively in G. If u is visited before v during the breadth first traversal, which of the following statement is correct?
10The Knapsack problem where the objective function is to minimize the profit is -
11If P denotes '+', R denotes '×', S denotes '−' and T denotes '÷', then what will be the value of 5R9P7S9T3P6?
12An advantage of chained hash table (external hashing) over the open addressing scheme is -
13Which one of the following is an application of queue data structure?
