Daa Assignment
Daa Assignment
For the ensuing questions, you are permitted to collaborate in pairs for the assignment submission.
It is essential to distinctly specify each participant's contributions. Moreover, a minimum of two
problems must be tackled utilizing either C++ or Java.
Q.1 Commence the initial stage by coding the core sorting algorithms, namely:
In-Place Quick Sort( Pick the pivot as the last element )
3-Way Merge Sort
In-Place Heap Sort
Bucket Sort
Radix Sort (For this, the input is a linked list and it max. size is 25, in which one node
of the linked list possess exactly one element)
Afterward, create a series of random input test cases in diverse sizes, starting with a minimum
of 100, and including 500 and 1000. Proceed to assess the efficiency of these algorithms using
the criteria listed below:
Number of comparisons (where applicable)
Number of swaps (where applicable)
Number of basic operations (other than the ones mentioned above)
Execution time in milliseconds
Memory usage
Upon completing this evaluation, articulate your findings and deduce conclusions.
Submission Requirements:
Submit code files with clear, succinct comments. It’s important to note that code
embedded within document files (such as Word documents) is not permissible.
Include input data files that contain the test cases used for the assessment.
Provide a detailed report that encapsulates your analysis, complemented by
pertinent screenshots.
Q.2 Optimizations and strategic data structure applications can significantly refine each
algorithm’s performance. For guidance on implementation, consider consulting “Algorithm
Design” by Goodrich et al., along with other pertinent scholarly texts viz., CLRS book.
Detail the refinements applied to the algorithms and expound on how these modifications
have elevated their efficiency. This should be substantiated both in theory and through
empirical comparison, employing extensive and varied input test cases, against the
algorithms’ initial versions.
Q.3 In “Algorithm Design” by Goodrich et al., a variety of algorithms are explicated, along with
suggested modifications for enhanced efficiency:
a. Chapter 6 addresses the algorithm for detecting strongly connected components,
articulation points, and bridges, incorporating both elementary and sophisticated
improvements.
b. Chapter 7 provides a detailed exposition of Dijkstra’s algorithm for determining the
shortest path from a singular source, inclusive of the path’s cost ( that includes
negative edge weights) and the actual route to all other vertices, as well as its variant
algorithms.
c. The text also explores Boruvka’s algorithm for calculating the minimum spanning
tree, presenting both the MST’s cost and its structure, in addition to different
implementation methods.
For each algorithm, undertake an analysis of performance across various implementations—
those delineated in the textbook and your selected alternatives—emphasizing the count of
primitive operations, duration of execution, and memory consumption. Inputs should include
expansive graphs of varied configurations, with at least 20 nodes. Clarify the
implementations, inclusive of their modifications, and rationalize the design decisions made,
as well as the resultant effects of the diverse algorithms.
Instructions for Submission:
Supply code files with explicit commentary. It is important to note that code inserted
into text documents, such as Word files, will be deemed unacceptable.
Append input data files that encompass the test cases employed for the performance
evaluation.
Present a thorough report that outlines the alterations, integrates an analytical
perspective, and is supplemented with illustrative screenshots.
Q.4 "Snakes and Ladders," a venerable board game with origins tracing back to no later than the
16th century in India, is played on a board that forms an n X n grid. This grid is sequentially
numbered from 1 to n^2, commencing at the lower left corner and advancing row by row
from the bottom to the top, with each row alternating direction. Within this grid, specific
square pairs, always situated in distinct rows, are interconnected by "snakes" (descending) or
"ladders" (ascending). No square may serve as the terminal point for more than one snake or
ladder. The objective is to be the swiftest to arrive at the final square, n X n, also known as
the paramapatam.
Play begins with a token placed on square 1, located at the bottom left. Each turn allows the
player to move their token forward by up to k spaces ( k <= 6 ), where k is a predetermined
constant. Should the token conclude its move on a snake's head, it must descend to the
snake's tail. Conversely, landing on the base of a ladder means the token ascends to the
ladder's top.
You are presented with a board characterized by a) its size n X n (with n being no less than 8),
b) the count of snakes and ladders, and c) the starting and ending grid positions of each snake
and ladder. Your task is to confirm that the board adheres to these stipulations:
Points to Ponder:
Kindly ensure that you submit an individual zip file for every distinct problem. It is crucial to
comply with the anti-plagiarism rules set for this task. Reproducing content from fellow
students, online sources, or AI-generated content will result in the nullification of the entire
assignment. Should you refer to any external resources, they must be accurately referenced
in your report, along with a detailed account of how they informed your work.