0% found this document useful (0 votes)
8 views

Assignment ETE

The document outlines an assignment for an Advanced Data Structures and Algorithms course, requiring students to implement various algorithms and data structures. It includes tasks such as computing Fibonacci numbers, detecting cycles in graphs, finding connected components, and solving optimization problems like the knapsack problem. Additionally, students must analyze time and space complexities and compare different data representation methods.

Uploaded by

try.kushagra2004
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)
8 views

Assignment ETE

The document outlines an assignment for an Advanced Data Structures and Algorithms course, requiring students to implement various algorithms and data structures. It includes tasks such as computing Fibonacci numbers, detecting cycles in graphs, finding connected components, and solving optimization problems like the knapsack problem. Additionally, students must analyze time and space complexities and compare different data representation methods.

Uploaded by

try.kushagra2004
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/ 2

School of Computing Science & Engineering

Course: Advanced Data Structures and Algorithms (R1UC503B)


Assignment 4 (For ETE)
Note: Write the time and space complexity of the program/function given in the
assignment. In addition to these questions implement all the lab programs.

1 Write a program to compute the nth Fibonacci number using dynamic programming (Top
down and bottom-up approach). Calculate the complexities of both the program.

2 Write a function to detect a cycle in a simple undirected graph using DFS.

3 Write a function to find the number of connected components in an undirected graph


using BFS.
4 Write a function to perform BFS on a graph from a given start vertex and return the order
of vertices visited.
Write a function to perform DFS on a graph from a given start vertex and return the order
of vertices visited.

5 Write a function to select the maximum number of non-overlapping activities from a


given list of activities with start and end times.

6 Write a function to find the minimum number of coins needed to make up a given amount
using a set of coin denominations.

7 Write a function to find the Minimum Spanning Tree of a graph using Kruskal’s
algorithm.

8 Write a function to find the Minimum Spanning Tree of a graph using Prim’s algorithm.

9 Write a function to find the contiguous subarray with the maximum sum using Kadane’s
algorithm.

10 Write a function to solve the fractional knapsack problem given weights, values, and the
maximum capacity of the knapsack.

11 Write a function to construct the Huffman Tree and encode a set of characters with
given frequencies.
12 Write a function to schedule jobs with deadlines and profits to maximize the total
profit.
13 Write a function to generate all possible subsets of a given set of numbers using
backtracking.

14 Write a function to determine the minimum cost to reach the top of a staircase given a list
of costs associated with each step.

15 Write a function to solve the N-Queens problem by placing N queens on an N×N


chessboard so that no two queens threaten each other.

16 Write a function to generate all possible permutations of a given list of numbers or


characters using recursion.
17 Write a function to solve the 0/1 Knapsack problem given a set of items with weights and
values and a maximum weight capacity.

18 Write a function to find all connected components in a graph and return the vertices in
each component.
School of Computing Science & Engineering
19 Write a function to find all subsets of a given set that sum up to a specific target value
using backtracking.

20 Write a function to find the shortest path between all pairs of vertices in a graph
using the Warshall algorithm.
21 Compare the advantages and disadvantages of using an adjacency matrix vs. an
adjacency list for representing a graph.
22 Evaluate how the greedy strategy for the fractional knapsack problem compares to
the dynamic programming approach in terms of efficiency.
23 Analyze the differences in the traversal results of BFS and DFS on a graph with
varying edge densities.
24 Compare different dynamic programming approaches to find the longest common
subsequence with respect to time complexity and memory usage.
25 Create a function to generate all possible permutations of a given list of numbers.
26 How does the concept of overlapping subproblems apply to the minimum number of coins
problem?
27 How does the sum of the subset problem illustrate the use of backtracking?
28 Define probabilistic data structures? Where are these used. Explain what is
Bloom’s filter.
29 Explain how connected components can be identified in an undirected graph using
DFS.
30 Evaluate the advantages and disadvantages of using an adjacency matrix versus an
adjacency list for graph representation.

You might also like