DAA-Assignment - 1
DAA-Assignment - 1
A) Instructions:
1. Answer any THREE questions from each unit.
2. Each question carries 5 marks.
3. The due date for submission on or before: 1/4/2024
4. The late submission, no marks will be awarded.
5. Write assignment in blue books only.
6. Paste the screen shots of minimum 2 different and unique inputs and
outputs
B) Rubrics for Programming Questions: - Max – 20 Marks per question which
will be reduced as per requirement.
Needs
Criteria Excellent (5) Good (4) Fair (3) Improvement Inadequate (1)
(2)
Program fully Program meets Program Program meets Program does
meets all most partially meets few requirements not meet
Functionality
requirements and requirements requirements and/or doesn't requirements or
works and works and works work work
Code is Code is
Code is well- Code is mostly Code is difficult
somewhat unreadable or
Code Quality structured, clear, well-structured to follow or
difficult to excessively
and easy to read and readable messy
follow messy
Sufficient
Comprehensive Comments are Lack of No comments or
comments
Documentation comments sparse or comments or documentation
explaining
throughout code unclear documentation provided
major parts
Extensive testing Inadequate
Testing covers Limited testing No testing
Testing covering various testing or no
most cases coverage provided
cases testing provided
C) Example of evaluation: -
Criteria Excellent (5) Good (4) Fair (3) Needs Improvement (2) Inadequate (1)
Functionality 2
Code Quality 3
Documentation 1
Testing 3
E) Assignment Problems: -
UNIT - 1
UNIT - 2
1. Implement a sequential search algorithm to find the position of a target
element in an array for large inputs, plot the execution time against input size.
2. Write a function to check if all elements in an array are unique and discuss the
efficiency of your uniqueness checking algorithm for large datasets.
3. Implement an exhaustive search algorithm to solve the Travelling Salesman
Problem for a given set of cities and distances and discuss the time complexity
and limitations of the exhaustive search approach for large city datasets.
4. Solve the Knapsack Problem using an exhaustive search approach and analyze
the efficiency of your solution for different sizes of the knapsack and item sets.
5. Implement a brute-force string matching algorithm to find the occurrences of
a pattern in a given text and compare the time complexity of the brute-force
approach with more advanced string matching algorithms.
6. Explain the characteristics that make hash functions suitable for various
applications. Discuss how properties like determinism, efficiency, and collision
resistance contribute to their effectiveness in data processing.
7. Compare and contrast the division method and the multiplication method of
designing hash functions. Highlight the advantages and disadvantages of each
approach, considering factors such as simplicity, uniformity of distribution,
and computational efficiency.
8. Investigate the division method used in hash functions. Discuss the key steps
involved and potential challenges or limitations. Additionally, provide
examples to illustrate situations where the division method might be more or
less effective in achieving a uniform distribution of hash values.
9. Explore the multiplication method employed in hash functions. Explain the
rationale behind this technique and analyze how it addresses specific issues in
hash function design. Include practical examples to demonstrate the
application and potential pitfalls of the multiplication method.
10. Hash collisions can be a significant concern in hash functions. Present a
scenario where collision resolution becomes challenging, and discuss potential
strategies for mitigating collisions. Elaborate on the trade-offs associated with
these strategies and how they impact the overall performance and reliability
of hash functions.