You are on page 1of 8

HOLYCROSS ENGINEERING COLLEGE

DEPARTMENT OF COMPUTER SCIECNE AND ENGINEERING

CS5151-ADVANCED DATA STRUCTURES AND ALGORITHMS

(I-ME-CSE : R2017)

UNIT I : ROLE OF ALGORITHMS IN COMPUTING


Algorithms - Algorithms as a Technology- Insertion Sort - Analyzing Algorithms - Designing
Algorithms- Growth of Functions: Asymptotic Notation - Standard Notations and Common
Functions- Recurrences: The Substitution Method - The Recursion-Tree Method

PART-A
1. What is mean by algorithm
2. Write any four properties of algorithm
3. Define algorithm validation
4. How to choose best searching algorithm
5. Write an algorithm to find the number of binary digits in the binary representation of the
positive decimal integer
6. What is average case analysis
7. What are the components of fixed and variable part in space complexity
8. Give any two example explaining the time space tradeoff
9. Prove that any comparison of sorting
10. Write down the properties of asymptotic notations
11. Define theta notation
12. Define little Oh and Omega Notations
13. Define Big-Oh notation
14. Write a recursive Fibonacci algorithm and its recursion relation
15. What is meant by substitution method
16. What is meant by linear search
17. Give example for recurrence equation
18. Write General plan for analyzing efficiency of recursive algorithm
19. Write an algorithm for factorial of numbers using recursion function
20. Write General plan for analyzing efficiency of non recursive algorithm

PART-B
1. Define the term algorithm and mention its properties
2. What are the steps that need to be followed while designing and analysis an algorithm?
3. Write the insertion sort algorithm and estimate its running time
4. What is space complexity ?With an example explain the components of fixed and variable
part in space complexity
5. Explain analysis framework of algorithm with suitable example
6. Discuss in detail all the asymptotic notation with example
7. Distinguish between Big-Oh ,Theta and Omega Notation
1
8. Discuss the properties of big-oh notation
9. Solve the following recurrence relation using substitution method(8)
1. T(n)=T(n-1)+1 with T(0)=0 as initial condition. Also find big-oh notation
2. T(n)=2T(n/2)+n
3. T(n)=T(n/3)+C with T(1)=1
4. T(n)=T(n-1)+n4
10. Solve the following recurrence relation using recursion tree method(8)
1. T(n)=2T(n/2)+n with T(1)=O(1)
2. T(n)=3T(n/4)+Cn2
11. Solve the recurrence relation using master method(8)
1. T(n)=5T(n-2)-6T(n-2)
2. T(n)=2T(n/2)+nlogn
3. T(n)=9T(n/3)+n3
12. Find the closest asymptotic tight bound by solving the recurrence equation T(n)=8T(n/2)+n2
with T(1)=1 using recursion tree method [Assume that T(1)€O(1)]
13. Suppose W satisfies the following recurrence equation and base (where C is a
constant)W(n)=c.n+W(n/2) and W(1)=1 what is the asymptotic order ofW(n)
14. Solve the recurrence equation(NOV/DEC12)(4+4)
𝑛
(1)T(n)={2𝑇 ( 2) + 3 𝑛 > 2
2 𝑛=2
15. Give the algorithm to check whether all the elements in a given array of n elements are
distinct. Find worst case Complexity of the same
16. Derive the recursion relation for fibonacci series algorithm also carry out the time
complexity analysis
17. Discuss How recurrence equation can be solved
18. Explain Towers of Hanoi problem and solve it using recursion
19. Show how to implement a stack using two queues. Analyze the running time of the stack
operation

UNIT II : HIERARCHICAL DATA STRUCTURES


Binary Search Trees: Basics - Querying a Binary search tree - Insertion and Deletion- Red-Black trees:
Properties of Red-Black Trees - Rotations - Insertion - Deletion -B-Trees: Definition of B- trees - Basic
operations on B-Trees - Deleting a key from a B-Tree- Fibonacci Heaps: structure - Mergeable-heap
operations- Decreasing a key and deleting a node-Bounding the maximum degree.

PART-A
1. Give various implementation of tree
2. Define Binary and Complete binary tree
3. How is binary tree represented using an array?
4. Construct an expression tree for the expression A+(B-C)*D*(E+F)
5. Write an algorithm to declare node of a tree structure
6. What are the application of tree
7. What are B-tree
8. Enlist the properties of B-tree
9. What are red black tree
10. Explain the properties of red-black tree

2
11. What are the advantages of Fibonacci heap
PART-B
1. Discuss about various operation of binary search tree with suitable example(16)
2. Explain the insertion and deletion of nodes in the B-tree with suitable example and also
explain the properties of B-tree(16)
3. Explain the insertion and deletion of nodes in the Red-black tree with suitable example and
also explain the properties of Red-black tree(16)
4. Explain what are the operation performed in Fibonacci heap(16)
Problem(8)
1. Draw the binary search tree for the following input list 60,25,75,15,50,66,33,34.Trace the
algorithm to delete the node25,75,44,fromthe tree
2. Draw the Red-Black tree for the following input list 60,25,75,15,50,66,33,34.Trace the
algorithm to delete the node25,75,44,fromthe tree
3. Explain insertion procedure in Red-Black tree and insert the following sequence: {
20,10,5,30,40,57,3,2,4,35,25,18,22,21} (8)
4. Construct a binary search tree by inserting 30,10,4,19,62,35,28,73 into an initially empty
tree .show the result of splaying the nodes 4, 62 one after the other of the constructed
tree.(10)
5. construct a B-tree with order m=3 for the key values 2,3,7,9,5,6,4,8,1 and delete the values
4,6,show the tree in performing all operations(6)

UNIT III : GRAPHS


Elementary Graph Algorithms: Representations of Graphs - Breadth-First Search - Depth-First Search -
Topological Sort - Strongly Connected Components- Minimum Spanning Trees: Growing a Minimum
Spanning Tree - Kruskal and Prim- Single-Source Shortest Paths:The Bellman-Ford algorithm - Single-
Source Shortest paths in Directed Acyclic Graphs - Dijkstra‘s Algorithm; All-Pairs Shortest Paths:
Shortest Paths and Matrix Multiplication - The Floyd- Warshall Algorithm;

PART-A

1. What are the storage representation of the graph


2. What are the application of graph
3. Prove the number of odd degree vertices in a connected graph should be even
4. Differentiate between Prim’s and Kruskal’s algorithm
5. Define spanning tree of a graph
6. What are articulation points
7. Define regular graph
8. Define critical path
9. What is weakly connected graph
10. What is the purpose of Dijkstra’s algorithm
11. What is adjacency list ?when it is used
12. What is an activity node graph
13. When graph is said to be bipartite
14. What is directed and undirected graph

3
PART-B
1. Discuss Prim’s and Kruskal’s algorithm for computing the minimal spanning tree weighted
undirected graph(16)
(OR)
i)Explain Prim’s algorithm to find the minimum spanning tree for a graph(8)
ii) Explain Kruskal’s algorithm to find the minimum spanning tree for a graph(8)
2. Explain BFS and DFS in detail .Write the algorithm(16)
(OR)
i) Explain breadth first search algorithm for traversal of any graph with suitable
example? Define the time complexity(8)
ii) What is graph? Explain the depth first search tree (8)
3. Explain the topological Sorting algorithm(8)
4. Discuss all pair Shortest path algorithm with an example (16)
(OR)
i)Explain Dijkstra’s algorithm with suitable example(8)
ii)Explain Floyd’s Algorithm with suitable example(8)
iii)Explain about warshall algorithm with example
Apply Prim’s algorithm to find a minimum spanning tree of a graph(8)

1
b c

5 3 4 6

a d e
6 2

Sort the given digraph using topological sort with suitable step(8)

A D

B E

4
8. i)Write an algorithm, for breath first search on a gragh and give the nodes of the graph G
given diagram based on the algorithm
ii)using Dijikstra’s algorithm find the shortest path from the source to all other nodes of the
graph given (16)
2
V1 V2
4 1 3 10

V4
V3 5 2 2 V5

5 8 6
1
V6 V7
Consider a directed acylic graph D given in fig sort the node nodes of ‘D’ by applying
topological sort on D(10)

C
F
A B E

D
G
.

for the given graph

i)find the shortest path from vertex 1 to all other vertice(8)

ii)find the shortest path from each vertex to all other vertex(8)

mention and use the appropriate algorithm

2 4
3

8 3
1
7 1
2
4 5

5 4
6

5
Explain Prim’s and Kruskal algorithm .Find the minimum spanning tree for the following graph
using any one of the algorithm’s(16)

3
b c
4 4 2 3
2 11
a e d

2 1 3
5
f g
4

UNIT IV : ALGORITHM DESIGN TECHNIQUES


Dynamic Programming: Matrix-Chain Multiplication - Elements of Dynamic Programming -
Longest Common Subsequence- Greedy Algorithms: An Activity-Selection Problem - Elements of the
Greedy Strategy- Huffman Codes.

PART-A

1. List out the advantages of Dynamic Programming


2. Compare greedy technique with dynamic programming method(
3. Compare Divide and Conquer with Dynamic programming and Dynamic Programming
with greedy method
4. What is the best algorithm suited to identify the topography for a graph .Mention its
efficiency factors
5. State how dynamic Programming solves complex problem
6. For what type of problem greedy algorithm are best suited(MAY/JUNE 11)
7. Devise an algorithm to make a change for 1655 using the Greedy strategy The coins are
available are {1000,500,100,50,20,10,5}(APR/MAY11)
8. Differentiate between subset paradigm and ordering paradigm
9. Write control abstraction for the ordering paradigm
10. What is the purpose of huffman’s tree
PART-B
DYNAMIC PROGRAMMING

1. How dynamic programming is used for computing Binomial Coefficient(16)


2. Consider the following graph solve all pairs shortest path problem of the graph .the al pair
shortest paths problem is to determine the shortest path between every pair of vertices(8)

6
GREEDY TECHNIQUE

Prim’s algorithm

1. Construct the minimum spanning tree using prim’s algorithms(8)


2. Explain Prim’salgorithm for constructing minimum cost spanning tree(8)

4
1 3

2
6
216 7 5 7

4
9

Kruskal’s Algorithm

3. Explain Kruskal’s algorithm for constructing minimum cost spanning tree(8)


4. Explain Dijistra’s algorithm for constructing minimum cost spanning tree(8)
5. Consider the graph given below fins the minimum spanning tree of this graph using
a)Kruskal’s algorithm b)Dijkstra’s algorithm(16)

7
Huffman trees

6. The Binary string below in the title of a song encoded using Huffman code
001100010111110011101100000100111010010101
Gibe n the letter frequencies listed in the table below build the Huffman coded and use them
to decode the title .In cases where there are multiple greedy choices the coded are assembled
by combining the first letters from left to right in the order given in the table.Also the code
are assigned by labeling the left and right branches of the prefix/code tree with ) and 1
respectively
Letter a h v w ‘’ e t l o
Frequency 1 1 1 1 2 2 2 3 3
7. Write the procedure to compute Huffman code(6)
8. Let A={l/119,m/96,c/247,g/283,h/72,f/77,k/92,j/19}be the letters and its frequency of
distribution in a text file .Compute a suitable Huffman coding to compress the data
effectively(8)
9. Explain about Huffman tree with example(8)

UNIT V : NP COMPLETE AND NP HARD


NP-Completeness: Polynomial Time - Polynomial-Time Verification - NP- Completeness and
Reducability - NP-Completeness Proofs - NP-Complete Problems

PART-A
P-NP-NP Complete Problems
1. Depict the proof which says that a problem ‘A’ is no harder or no easier than problem
‘B’
2. How NP hard problem are different from NP-Complete
3. Compare NP-hard and NP-completeness
4. State the property of NP-Complete Problem
5. List the two properties that must be satisfied by a problem L to be NP complete
6. What is NP Completeness
PART-B

1. Explain the P , NP and NP completeness with suitable example (16)


2. Explain Cook’s theorem(8)
3. Using an example prove that satisfiablitity of Boolean formula in 3-conjunctive Normal
Form is NP-complete(12)
4. Write notes on deterministic and non-deterministic algorithms(8)
5. State the relationship among the complexity class algorithms with the help of neat
diagrams(4)
6. Suggest an approximation algorithm, for traveling salesperson problem. Assume that the
cost function satisfies the triangle inequality(8)
7. Implement an algorithm for Knapsack problem using NP-hard approach(8)
*****

You might also like