BPSC TRE · Computer Science

Algorithms Previous Year Questions

9 Algorithms (Computer Science) questions asked in BPSC TRE previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.

  • 9 questions
  • Official answer key
  • Free

Other Computer Science topics

Q1BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is Booth’s algorithm used for?
  1. ABinary to decimal conversion
  2. BDecimal to binary conversion
  3. CBinary multiplication
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Binary multiplication

Explanation

Booth's algorithm multiplies signed binary numbers in two's complement form.

Q2BPSC TRE 3.0 (2024) Computer Science Class 11-12
The order of the binary search algorithm is _______.
  1. AN
  2. BN log n
  3. CN²
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (E) None of the above

Explanation

Binary search halves the search range at each step, so its order is O(log n). That is not among N, N log n or N².

Q3BPSC TRE 3.0 (2024) Computer Science Class 11-12
How many distinct binary search trees can be created out of 4 distinct keys?
  1. A8
  2. B24
  3. C14
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) 14

Explanation

The number of distinct BSTs on n keys is the Catalan number C(n) = (2n)!/((n+1)! n!). For n = 4, C(4) = 14.

Q4BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following statements is true about Big-O notation?
  1. AIt represents the lower bound of an algorithm’s runtime.
  2. BIt represents the upper bound of an algorithm’s runtime
  3. CIt represents the average runtime of an algorithm.
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) It represents the upper bound of an algorithm’s runtime

Explanation

Big-O gives an asymptotic upper bound on the growth of an algorithm's running time, usually used for the worst case. Big-Omega gives the lower bound.

Q5BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT a step in the Divide and Conquer algorithm?
  1. ACombine
  2. BConquer
  3. CDivide
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (E) None of the above

Explanation

Divide and Conquer has three steps: divide, conquer and combine. All three listed options are steps, so none of them is "NOT a step".

Q6BPSC TRE 3.0 (2024) Computer Science Class 11-12
Merge Sort is an example of which algorithm design paradigm?
  1. AGreedy
  2. BDivide and Conquer
  3. CDynamic Programming
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) Divide and Conquer

Explanation

Merge sort splits the array into halves, sorts each half recursively and merges them, which is the divide-and-conquer paradigm.

Q7BPSC TRE 3.0 (2024) Computer Science Class 11-12
Which of the following is NOT an NP-Complete problem?
  1. ATraveling Salesman Problem
  2. BBoolean Satisfiability Problem
  3. CShortest Path Problem
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Shortest Path Problem

Explanation

The shortest path problem can be solved in polynomial time (for example with Dijkstra's algorithm), so it is not NP-complete. TSP (decision version) and SAT are NP-complete.

Q8BPSC TRE 3.0 (2024) Computer Science Class 11-12
What is the computational complexity of the halting problem?
  1. AO(1)
  2. BO(n)
  3. CNot computable
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (C) Not computable

Explanation

Turing proved the halting problem is undecidable: no algorithm can decide for every program and input whether it halts. So it has no computational complexity; it is not computable.

Q9BPSC TRE 1.0 (2023) Computer Science Class 11-12
What is the time complexity of an infix to postfix conversion algorithm?
  1. AO(N log N)
  2. BO(N²)
  3. CO(N)
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) O(N²)

Explanation

Note: the answer key gives (B), but infix-to-postfix conversion scans each symbol once and pushes and pops each operator at most once on the stack, so it takes O(N) time.

How to use these BPSC TRE Computer Science questions

Every question here was asked in a real BPSC TRE paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full BPSC TRE papers as timed tests to check your speed under exam conditions.

More BPSC TRE subjects