0% found this document useful (0 votes)
18 views6 pages

Assignment Fundamental

The document outlines various topics related to algorithms and data structures, including priority queues, sorting algorithms, complexity classes, and graph algorithms. It poses questions and tasks that require explanations, algorithm implementations, and comparisons between different algorithmic approaches. Additionally, it covers asymptotic analysis, NP-Completeness, and specific algorithms like Dijkstra's, Bellman-Ford, and Huffman coding.

Uploaded by

beheraronak2
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)
18 views6 pages

Assignment Fundamental

The document outlines various topics related to algorithms and data structures, including priority queues, sorting algorithms, complexity classes, and graph algorithms. It poses questions and tasks that require explanations, algorithm implementations, and comparisons between different algorithmic approaches. Additionally, it covers asymptotic analysis, NP-Completeness, and specific algorithms like Dijkstra's, Bellman-Ford, and Huffman coding.

Uploaded by

beheraronak2
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/ 6

Assignment

1. What is meant by a priority queue? Classify its types and describe their behaviour?
2. What is meant by polynomial time solvability?
3. Sort the following array using the Selection Sort algorithm:
Given Array: [8, 4, 1, 5, 2]
4. How do Greedy algorithms differ from Dynamic Programming techniques?
5. Define reducibility in the context of NP-Completeness ?
6. Define Ω notation in asymptotic analysis and state its significance.
7. While the Bellman-Ford algorithm is useful, it has certain drawbacks. What are these
limitations ?
8. Describe how a min-heap works compared to a max-heap. How do their root
elements differ?
9. Arrange the following time complexities in ascending order:

O(n!),O(nlogn),O(1),O(n2)

10. Which two algorithms are commonly used to find the Minimum Spanning Tree (MST)
of a graph?

2. a) i) Explain asymptotic notation with types, graphs and equations.

ii) Determine the computational complexity of the recurrence relation defined as: T(n) =
2T(n/2) + n²

Employ the recurrence tree approach to derive the asymptotic time complexity. Ensure that
all intermediary steps are demonstrated, leading toward the final asymptotic bound.

OR

b) i) Derive the solution to the recurrence relation defined as T(n) = 2T(n/2) + n by applying
the substitution method. Demonstrate a rigorous proof to validate the asymptotic bound of
the recurrence.

ii)Elaborate upon the notions of time complexity and space complexity. Highlight their
individual roles in the performance evaluation of algorithms, and articulate how they
contribute to the overall computational efficiency.

iii) Present a formal definition of Theta (Θ) notation. Discuss its theoretical significance
within the realm of algorithm analysis, especially in establishing asymptotic tight bounds ?
3. a) i) Trace the steps of Merge Sort for the array [38, 27, 43, 3, 9, 82, 10].
ii) Using the Master Theorem, solve the following recurrence relation for its time complexity:
T(n) = 3T(n/4) + n²
Provide the value of the time complexity by identifying the correct case of the Master
Theorem, and explain how the recurrence fits into that case.
iii) Explain Selection Sort with a suitable example.
OR

b) i) Explain Heap Sort with an example.


ii) Arrange the given Elements by using Quick Sort :50,40,20,70,15,35,20,60
iii) Is Merge Sort a stable sorting algorithm? Why or why not?
4.

a) i) Construct the Huffman tree for the given character set based on their
frequencies.

Char X Y Z W V
Count 7 3 4 5 2

ii) A thief plans to fill a bag that can carry up to 15 units of weight. There are 7
valuable items available, each with a specific weight and profit.
Using the Fractional Knapsack approach, calculate the maximum profit that can be
earned by selecting whole or fractional parts of the items to completely or partially
fill the knapsack.

Objects 1 2 3 4 5 6 7
Profits 10 5 15 7 6 18 3
Weight 2 3 5 7 1 4 1

a) i) Find out the shortest path from Source A to all vertices using Dijkstra’s Algorithm.
ii) Define a Minimum Spanning Tree (MST). Explain how Prim’s algorithm and Kruskal’s
algorithm are used to construct the MST of a graph.

5. a)i) Explain the difference between BFS and DFS.


ii) Explain Floyd-Warshall Algorithm(All pair shortest path algorithm) with proper Algorithm.
iii)Write down the Time Complexity of BFS and DFS.
OR

b)i) Given a flow network with edge capacities, a source, and a sink, use the Ford-Fulkerson
algorithm to find the maximum flow from source to sink. Show the augmenting paths and
update the residual graph after each step.

ii) Implement the Rabin-Karp Algorithm to find all occurrences of the pattern in the text.
Text: "ababcabcabc", Pattern: "abc"

6. a) i) Explain the concept of complexity classes in the context of computational theory.


Why are they important in understanding algorithm performance and problem solvability?
ii) Provide a detailed overview of the major complexity classes (such as P, NP, NP-Complete,
NP-Hard, etc.). Highlight how they differ in terms of time and resource requirements.
iii) List and briefly describe three well-known NP-Complete problems. Explain why they are
considered NP-Complete.
OR

b)i) Discuss the concepts of verification and reducibility in computational theory. Why are
they important when analyzing problem complexity?

ii) Define and distinguish between P, NP, and NP-Hard complexity classes ?

iii) What does it mean for an algorithm or problem to be solved in polynomial time? Provide
a clear explanation with context ?.

11. How does Breadth-First Search (BFS) differ from Depth-First Search (DFS) in graph
traversal?
12. Insertion Sort
13. What is a Priority Queue, and how does it function when handling elements with
different priorities ?
14. Sort the following array using the Heap Sort algorithm:
[4, 10, 23, 56, 1, 34]
15. Bubble Sort
16. Explain the term “algorithm” and highlight its key characteristics that make it
effective in problem-solving.

17. Define Omega notation and its significance.


18. What is the difference between time complexity and space complexity?
19. Define a priority queue and types of Priority Queue.
20. What is the difference between min-heap and max-heap?
21. Differentiate between Greedy and Dynamic Programming approaches.
22. Name two algorithms used for finding the Minimum Spanning Tree (MST).
23. What are the limitations of Bellman-Ford algorithm?
24. What is an NP-hard problem?
25. Arrange the following time complexities in ascending order:
26. O(n!),O(nlogn),O(1),O(n)
27. What is the difference between deterministic and non-deterministic algorithms?

28. a)i) Solve the recurrence relation T(n)=2T(n/2)+n using the Substitution method.
ii) What is Time Complexity and What is Space Complexity.
iii) Define Theta notation and its significance.
OR

a)i) Explain the different asymptotic notations with graphs and equations.
ii) Find out the time complexity by using recurrence tree method.
T(n)=2T(n/2) +n2
29. a) i) Explain Merge Sort with an example.
ii) Derive the Worst Case time complexity of Merge sort from the recurrence relation.
OR

b)i) Explain Bubble Sort with an example.


ii) Explain Insertion Sort.
iii)What is the worst case time complexity of Quick Sort.

30.a)i) Explain Huffman coding with an example and a step-by-step tree formation.

Char A B C D E
Count 3 5 6 4 2

ii) What is a Minimum Spanning Tree (MST), and how do Prim’s and Kruskal’s algorithms find
the MST of a given graph?

31. a) i) Find out the shortest path from Source A to all vertices using Dijkstra’s Algorithm.

A-B=4, B-D=9, D-F=2, A-C=5, C-E=3, E-F=6,B-C=11, B-E=7,D-E=13

ii) Find out the total Profit Using Fractional Knapsack Problem.

Here no. of objects=7, Knapsack Capacity=15

Objects 1 2 3 4 5 6 7
Profits 10 5 15 7 6 18 3
Weight 2 3 5 7 1 4 1
32 . a) i) Find the maximum flow through the given network using Ford-Fulkerson
algorithm.

ii) Implement the Rabin-Karp Algorithm to find all occurrences of the pattern in the text.
Text: "abdbcabdcabca", Pattern: "bca"

OR

a) i) Explain the difference between BFS and DFS


ii) Explain Floyd-Warshall Algorithm(All pair shortest path algorithm) with proper
Algorithm.
iii)Write down the Time Complexity of BFS and DFS.
33. a) i) Describe About Complexity Classes?
ii) Write down the detailed explanation about the type of Complexity Classes.
iii) Write three examples of NP-Complete Problems.
OR

a)i) Explain P-Class,NP-Class and NP-Hard Class.


ii) What is Polynomial time?
iii) Explain Verification and Reducibility.

34. Selection Sort


35. Priority Queue
36. What is Algorithm ? write details about Characteristics of Algorithm.
37. Heap Sort
38. longest common subsequence
39. Find out the time complexity by using master’s method.
T(n)=8T(n/2) +n2

You might also like