Code: 105402Computer Science & Eng.4th Semester6 Examination Papers

Design and Analysis of Algorithms

Official Bihar Engineering University examination question papers, marks distribution, and questions transcript. Available exam sessions: 2025, 2023, 2022, 2020, 2019, 2018.

Exam Year:

Get Instant AI Answers on this Paper

Open BEU Connect Android app to solve any numerical or derive formulas step by step.

Ask AI in App
Official Exam Paper TranscriptB.Tech 4th Semester Examination, 2025
Bihar Engineering University, Patna
B.Tech 4th Semester Exam., 2025

Design & Analysis of Algorithms

Time: 03 HoursCode: 105402Semester: IVFull Marks: 70

Instructions:

  1. The marks are indicated in the right-hand margin.
  2. There are NINE questions in this paper.
  3. Attempt FIVE questions in all.
  4. Question No. 1 is compulsory.
Q.1 Choose the correct option / answer the following (Any seven questions only):[2 x 7 = 14]
  1. An algorithm is said to be finite if

    1. It uses finite memory
    2. It produces correct output
    3. It has finite input
    4. It terminates after a finite number of steps
  2. In Master’s theorem, if f(n) = Θ(nlogba), then the solution of the recurrence is

    1. Θ(f(n))
    2. Θ(f(n)logn)
    3. Θ(nlogba)
    4. Θ(logn)
  3. What is the maximum number of swaps that can be performed in the Selection Sort algorithm?

    1. n-1
    2. n
    3. 1
    4. None of the above
  4. The time complexity of Strassen’s Matrix Multiplication is approximately

    1. O(n3)
    2. O(n2)
    3. O(n2.81)
    4. O(n logn)
  5. Which of the following problems can not be solved optimally by a greedy approach?

    1. Minimum Cost Spanning Tree
    2. Fractional Knapsack
    3. Job Sequencing with Deadlines
    4. 0/1 Knapsack
  6. In the Branch-and-Bound approach for the Traveling Salesman Problem (TSP), bounding is used to

    1. Find the exact optimal solution immediately
    2. Convert TSP into a dynamic programming problem
    3. Prune paths that cannot yield better solutions
    4. Sort cities by distance
  7. In the Matrix Chain Multiplication problem, the DP table stores

    1. The sum of matrix elements
    2. Minimum number of scalar multiplications needed for each subchain
    3. Maximum determinant of matrix chain
    4. Sequence of matrices in ascending order
  8. In 0/1 Knapsack DP solution, the state K[i][w] represents

    1. Maximum profit using the first i items for weight limit w
    2. Total number of items used
    3. Minimum weight required to achieve profit i
    4. Fraction of items included
  9. Topological sorting is applicable to

    1. Any graph
    2. Directed Acyclic Graph (DAG) only
    3. Undirected graphs only
    4. Cyclic graphs only
  10. An approximation algorithm guarantees

    1. Exact optimal solution
    2. Incorrect solution always
    3. Random solution without bounds
    4. Solution within a known factor of optimal
Q.2 Solve both questions :[7 x 2 = 14]
  1. Solve the following recurrence relations using the Substitution Method:
    (i) T(n)= 2T(n/2) + n, T(1)=1
    (ii) T(n)= T(n−1) + n, T(1)=1

  2. State and explain the Master’s Theorem. Apply it to solve the following recurrence relation: T(n)=3T(n/2)+n

Q.3 Solve both questions :[7 x 2 = 14]
  1. Describe the Merge Sort algorithm with a suitable example. Derive its time complexity using recurrence relations.

  2. Apply the Binary Search algorithm to find the key 41 in the sorted array [5,12,18,25,33,41,56,63,70]
    Also analyze its time complexity.

Q.4 Solve both questions :[7 x 2 = 14]
  1. Apply the Heap Sort algorithm to the array. [16, 14, 10, 8, 7, 9, 3, 2, 4, 1]. Show the initial heap, each deletion step, and the final sorted array. Also analyse the time complexity.

  2. Compare Greedy, Dynamic Programming, and Backtracking approaches with respect to solution strategy, efficiency, and applicability.

Q.5 Solve both questions :[7 x 2 = 14]
  1. A thief has a knapsack of capacity 50 kg. The items available are given below. Apply the Fractional Knapsack Algorithm to select items (or fractions) that maximize total value, and compute the total weight and total value in the knapsack.

    ItemWeight (kg)Value ($)
    11060
    220100
    330120
    41575
    52580
    61890
    71248
    8832

    Explain why this approach guarantees an optimal solution for the fractional knapsack problem.

  2. Apply Bellman Ford’s algorithm step-by-step on the given weighted matrix W to compute single-source shortest paths from node 3. State the time complexity of the algorithm.

    12345
    101814
    2101249
    3812073
    414702
    549320
Q.6 Solve both questions :[7 x 2 = 14]
  1. Discuss Dijkstra’s algorithm in detail with the help of an example. Explain why the algorithm fails for graphs containing negative edge weights. Also, state the time complexity of Dijkstra’s algorithm.

  2. Discuss the Dynamic Programming approach for solving the Fibonacci series problem. Explain how it improves efficiency over the recursive method.

Q.7 Solve both questions :[7 x 2 = 14]
  1. Given the distance matrix for 5 cities shown below, apply the Dynamic Programming approach to solve the Travelling Salesman Problem. Find the minimum cost tour starting and ending at City 1 and list the optimal tour. Show the key steps involved in computing the solution.

    12345
    1010152025
    2100352530
    3153503020
    4202530015
    5253020150
  2. Given the directed graph G(V,E) with vertices V= {1, 2, 3, 4, 5} and edges E= {(1, 2), (1,3),(2,4),(3,4),(4,5)}:
    (i)Represent the graph using an adjacency matrix.
    (ii) Represent the same graph using an adjacency list.

Q.8 Solve both questions :[7 x 2 = 14]
  1. What is a strongly connected component? Find all the strongly connected components in the following graph. Show all necessary steps and data structure values of the algorithm.

    Question Diagram
  2. What is P, NP, NP hard, and NP complete? Write the relationship between all of them.

Q.9 Write short note on any two of the following:[7 x 2 = 14]
  1. Huffman Coding Algorithm

  2. Heuristics

  3. BFS vs DFS

  4. Cook’s theorem

Related Official Syllabus

Formal Language and Automata Theory

105402

Official BEU curriculum units & topics for this examination subject.

Unit- 1.0: Introduction

Alphabet • Languages and grammars • Productions and derivation • Chomsky hierarchy of languages

Unit- 2.0: Regular languages and finite automata

Regular expressions and languages • Deterministic finite automata (DFA) and equivalence with regular expressions • Nondeterministic finite automata (NFA) and equivalence with DFA • Regular grammars and equivalence with finite automata • Properties of regular languages • Pumping lemma for regular languages • Minimization of finite automata

Unit- 3.0: Context-free languages and pushdown automata

Context-free grammars (CFG) and Context-free languages (CFL) • Chomsky and Greibach normal forms • Nondeterministic pushdown automata (PDA) and equivalence with CFG • Parse trees • Ambiguity in CFG • Pumping lemma for context-free languages • Deterministic pushdown automata • Closure properties of CFLs

Unit- 4.0: Context-sensitive languages

Context-sensitive grammars (CSG) and Context-sensitive languages • Linear bounded automata and equivalence with CSG

Unit- 5.0: Turing machines

The basic model for Turing machines (TM) • Turing recognizable (Recursively enumerable) and Turing-decidable (recursive) languages and their closure properties • Variants of Turing machines • Nondeterministic TMs and equivalence with deterministic TMs • Unrestricted grammars and equivalence with Turing machines • TMs as enumerators

View Complete 4th Semester Syllabus

Prepare Better with BEU Connect

  • Download papers for 100% offline study
  • Ask AI for step-by-step problem breakdown
  • Attempt official GATE CBT mock tests
  • Calculate SGPA and track attendance
Download Android App