0% found this document useful (0 votes)
7 views8 pages

QB Vandu

The document is a comprehensive question bank for the subject 'Analysis and Design of Algorithms' prepared by Vandana U for the BCS401 course. It includes questions across multiple modules covering topics such as algorithm definitions, time and space complexity, sorting algorithms, graph algorithms, dynamic programming, and backtracking techniques. Additionally, it provides exam preparation tips and module-wise quick tips to aid students in their studies.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views8 pages

QB Vandu

The document is a comprehensive question bank for the subject 'Analysis and Design of Algorithms' prepared by Vandana U for the BCS401 course. It includes questions across multiple modules covering topics such as algorithm definitions, time and space complexity, sorting algorithms, graph algorithms, dynamic programming, and backtracking techniques. Additionally, it provides exam preparation tips and module-wise quick tips to aid students in their studies.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Question Bank

Subject Code: BCS401 Subject: Analysis and Design of Algorithms


Prepared by: Vandana U
Scheme : 2022 Assistant Professor, Department of AI-DS
SMVITM , Bantakal

MODULE-1

1. Give the definition of an Algorithm and also discuss the characteristics of an Algorithm.
2. Define Space Complexity and Time complexity of an algorithm and compute the time complexity of
Fibonacci numbers algorithm.
3. What are the various basic Asymptotic efficiency classes? Explain the three notations(Big Oh, Big
Omega and Big Theta) in detail.
4. Give the mathematical analysis of non-recursive matrix multiplication algorithm.
5. Give the general plan for analyzing time efficiency of recursive algorithms and also analyze the tower
of Hanoi recursive algorithm.
6. Write an algorithm to find uniqueness of elements in an array and give the mathematical analysis
of this recursive algorithm with steps.
7. Define algorithm with specifications for writing algorithm.
8. Discuss fundamental data structures.
9. Explain the notion of an algorithm. Design Euclid’s algorithm for computing GCD(m,n). Find the
GCD(60,24) using Euclid’s algorithm.
10. Distinguish between the two common ways to represent a graph.
11. If t1(n) ∈ O(g1(n)) and t2(n) ∈O(g2(n)) , then prove that t1(n) + t2(n) ∈ O(max(g1(n), g2(n))).
12. Explain any four important problem types.
13. Explain general plan of mathematical analysis of recursive algorithms with example.
14. Write an algorithm to find maximum of ‘n’ elements and obtain its time complexity.
15. Explain general plan of mathematical analysis of non-recursive algorithm with an example.
16. What are asymptotic notations? List and describe the various asymptotic notations with an example of each.
17. What is the best, average and worst time efficiencies of Sequential search.
18. With the algorithm derive the worst-case efficiency for Bubble sort
19. With neat diagram explain different steps in designing and analyzing an algorithm
20. Explain the fundamentals of analysis framework of algorithms
21. Explain space and time complexity in detail with relevant examples for each.
22. Consider the following algorithm:

a. What does this algorithm compute? b. What is its basic operation? c. How many times is the basic
operation executed? d. What is the efficiency class of this algorithm?

MODULE-2
1. Explain Strassen’s Matrix Multiplication approach with example and derive its time complexity.
2. What is divide and conquer? Develop the quick sort algorithm and write its best case. Make use of
this algorithm to sort the list of characters: E,X,A,M,P,L,E.
3. Distinguish between decrease and conquer & divide and conquer algorithm design techniques with
block diagram. Develop insertion sort algorithm to sort a list of integers and estimate the efficiency.
4. Write an algorithm for Merge Sort. Also, demonstrate the applicability of Master’s theorem to
compute the time complexity of Merge Sort.
5. Define Topological sorting. List the two approaches of topological sorting and illustrate with
examples.
6. Explain the concept of Divide and Conquer. Write the recursive algorithm to perform Binary Search
on the list of elements.
7. Define Topological sorting. Illustrate the topological sorting for the following graph.

8. Write merge sort algorithm with example and also calculate the efficiency.
9. Solve the following instance of brute force knapsack problem where, n=4, m=10,p={40,42,25,12}
and w={4,7,5,3}.
10. Apply quick sort algorithm to sort the list: E,X,A,M,P,L,E in alphabetical order. Draw the tree of
recursive calls made.
11. List out the advantages and disadvantages of divide and conquer approach.
12. Define topological sorting. Illustrate the topological sorting using DFS method and Source Removal
method for the following graphs:

2
13. Apply Strassen’s algorithm for matrix multiplication to multiply the following matrices and justify
how the strassen’s algorithm is better.
4 3 x 1 2
[ ] [ ]
1 2 6 5

14. Apply merge sort and quick sort algorithm to sort the characters VTUBELAGAVI.
15. Write the Master theorem. Solve the following recurrence using it.
(i) T(n)=9T(n/3) + n (ii) T(n)=3T(n/4) + nlgn
16. Write the best and worst running time of Insertion sort algorithm. Why does it differ?
17. Write a program/algorithm of Insertion Sort Method. What is Complexity of it?
18. Apply Merge sort on these elements. 25,75,40,10,20,05,15. Find its worst case and Average case
efficiency.
19. Construct a 2-3 Tree for the list C, O M, P, U, T, I, N, G. Use the alphabetical order of letters and
insert them successively starting with the empty tree.
20. Design an insertion sort algorithm and obtain its time complexity. Apply insertion sort on these
elements. 25,75,40,10,20.
21. Discuss decrease and conquer algorithmic technique. Explain its variations.
22. Sort the below given array of elements using QuickSort. Mention time complexity.
2 6 4 3 9 1 7

3
Module-3
1. Define AVL tree with an example. Construct an AVL tree of keys: 6,5,8,3,2,4,7 indicating each step
of key insertion and rotation.
2. Define Heap. Explain the bottom-up heap construction algorithm. Apply the heap sort to sort the
list of numbers 2,9,7,6,5,8 in ascending order using array representation.
3. Define 2-3 tree. Give the worst case of operations on 2-3 tree. Build 2-3 tree for the list of keys
9,5,8,3,2,4,7 by indicating each step of key insertion and node splits.
4. Apply Heapsort for the list : {9,7,1,8,3,6,2,4,10,5} using Bottom-up approach.
5. Design Horspool Algorithm for string matching. Apply this algorithm to find the pattern BARBER in
the text: JIM_SAW_ME_IN_A_BARBERSHOP.
6. Explain Heapsort technique.
7. Construct a 2-3 Tree for the list C, O M, P, U, T, I, N, G. Use the alphabetical order of letters and
insert them successively starting with the empty tree.
8. Design Bottom-up Heap algorithm. Construct Bottom-up and Top Down heap for the list 2,9,7,6,5,8.
9. Sort the Following sequence using Heapsort algorithm, 15,20,7,9,30.
10. Define heap. Explain the properties of heap along with its representation.
11. Design comparison counting algorithm for sorting elements. Apply this algorithm to sort following
array elements 62,31,84,96,19,47.
12. Explain the 4 types of rotation in AVL trees with relevant examples.
13. Design the Distribution Counting algorithm. And assume that the set of possible lists of value is
{11,12,13}, sort the following list in alphabetical order by the distribution counting algorithm:
13,11,12,13,12,12.
14. Design Horspool string matching algorithm with shift table algorithm.
15. Design Horspool algorithm for string matching. Apply this algorithm to find the pattern BAOBAB in
the text BESS _ KNEW_ABOUT_BAOBABS.
16. Design Distribution Counting Sort for sorting elements. Apply this algorithm to sort following array
elements by considering frequency and distribution values.

4
Module-4
1. Explain Coin change problem with an example.
2. Compare dynamic programming and greedy technique [4 Marks]
3. A message consisting of the characters given in the table below has to be transmitted over a
network in a secured manner.

Character A M R _
Probability 0.4 0.2 0.3 0.1

(i) Construct Huffman tree for the given characters (Branch label: left (0), right (1))
(ii) Device Huffman codes for the given character.
(iii) Encode the text RAMA_RAMAR using Huffman codes.
(iv) Decode the text whose encoding is 1000101
(v) Compute the effectiveness of Huffman codes.

4. Construct minimum cost spanning tree using Kruskals algorithm for the following graph

Note: Numbers and Graphs


may differ. Kindly Learn the
Logic.

5. What are Huffman Trees? Construct the Huffman tree for the following data.
Character A B C D E -
Probability 0.5 0.35 0.5 0.1 0.4 0.2
Encode DAD-CBE using Huffman Encoding.
6. Apply Dijkstra’s algorithm to find single source shortest path for the given graph by considering S as
the source vertex.

5
7. Solve the instance of 0/1 knapsack problem for the data given below using Dynamic Programming
Item Weight Value
1 2 $12
2 1 $10
3 3 $20
4 2 $5
Capacity : 5

8. Define transitive closure of a graph. Apply Warshalls algorithm to compute transitive closure of a
directed graph.

9. Differentiate between Prim’s and Kruskal’s algorithm. Solve the below instance of Prim’s algorithm
to compute minimum cost spanning tree. Mention Time Complexity.

10. Define transitive closure of a graph. Write Warshalls algorithm to compute transitive closure.
Illustrate using the following directed graph.

11. Construct Huffman Tree and resulting code for the following:
Character A B C D -
Probability 0.4 0.1 0.2 0.15 0.15
i). Encode the text: ABACABAD
ii). Decode the text: 100010111001010.
12. Define Minimum spanning tree. Write Kruskal’s algorithm to find minimum spanning tree. Taking
your own graph, find the MST using Kruskal’s algorithm.
13. Prim’s algorithm:

6
14. Apply Floyd’s algorithm to find the transitive closure of the following graph shown below:

15. Apply Prim’s and Kruskal’s algorithm to find the minimal cost spanning tree for the graph given
below:

Module-5
1. Explain the following with examples i) P problem ii) NP Problem iii) NP- Complete problem iv) NP –
Hard Problems
2. Construct decision tree for three element selection sort.
3. What is backtracking? Apply backtracking to solve the below instance of sum of subset problem
S={5,10,12,13,15,18} d=30
4. Illustrate N queen’s problem using backtracking to solve 4-Queens problem
5. Using Branch and Bound technique solve the below instance of knapsack problem.
Item Weight Value
1 2 12
2 1 10
3 3 20
4 2 5
Capacity is 5.
6. Differentiate between Branch and Bound technique and backtracking. Apply backtracking to solve
the following instance of subset-sum problem S={3,5,6,7} and d=15. Construct the state space
tree.
7. Apply Branch and Bound approach to solve the instance of 0/1 Knapsack problem.
Knapsack Capacity W=10
Item 1 2 3 4
Weight 4 7 5 3
Value $40 $42 $25 $12

8. Explain greedy approximation algorithm to solve discrete knapsack problem.


9. Explain decision Tree with an example.

7
Exam Tips for ADA

General Preparation Tips


1. Understand the Core Concepts:
o Focus on time and space complexity, asymptotic notations, and algorithm design
techniques (Divide & Conquer, Greedy, Dynamic Programming, Backtracking, Branch &
Bound).
o Learn when to use which technique.
2. Work Out Traced Examples:
o Practice step-by-step trace tables for algorithms like:
▪ Quick Sort, Merge Sort, Dijkstra's, Prim's & Kruskal's, N-Queens.
o These often appear in exams!
3. Master Recurrences:
o Learn to solve recurrence relations using: Substitution Method, Recursion Tree, Master’s
Theorem – Very frequently asked!
4. Know Algorithm Types & Applications:
o Be clear with classifications: P, NP, NP-Complete, NP-Hard
o Focus on TSP, Knapsack, Hamiltonian circuit for NP/NP-Hard problems
5. Practice VTU Previous Year Questions:
o ADA has a patterned question paper. Solving previous years’ papers boosts confidence.
Module-Wise Quick Tips
Module 1: Introduction to Algorithms
• Definitions of algorithms, performance analysis
• Importance of asymptotic notations: O, Ω, Θ
• Solve basic recurrences using all 3 methods
Module 2: Divide and Conquer
• Algorithms: Merge Sort, Quick Sort, Binary Search, Max-Min
• Practice recurrence solving
Module 3: Greedy Method
• Study: Knapsack, Job Scheduling, MSTs (Prim’s & Kruskal’s), Dijkstra’s
• Understand greedy choice property and optimal substructure
Module 4: Dynamic Programming
• Fibonacci, Matrix Chain Multiplication, 0/1 Knapsack, All-pairs shortest path
• Understand overlapping subproblems & memorization
Module 5: Backtracking & Branch and Bound
• Practice: N-Queens, Hamiltonian Circuit, Subset Sum
• Difference between backtracking and B&B
• BFS & DFS-based search trees in B&B
Memory Aids and Scoring Tips
• Draw neat diagrams: State-space trees, recursion trees, MST graphs.
• Use step-by-step algorithm tracing.
• Keep algorithm syntax clean: Use clear steps and indentation.
• Highlight final answers and conclusions.
• Time Management: Don’t spend too long on trace-heavy problems.
****ALL THE BEST****

You might also like