Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment 1 : Chocolate Distribution ProblemSubsequently, they are expected to perform operations such as sorting and searching on the distributed chocolates. Weight: 5 g m
Assignment : Chocolate Distribution ProblemSubsequently, they are expected to perform operations such as sorting and searching on the distributed chocolates.
Weight:
Price: AED
Type: Almond chocolate
ID:
Weight: gm
Price: AED
Type: Peanut butter chocolate
ID:
Requirements:
Sorting the Chocolates:
Task:After distribution, create two lists of chocolates: one sorted by weight and the other by price.
Sorting Algorithm:Justify the choice of the sorting algorithm used eg Quick Sort, Merge Sort, etc.
Scalability: Discuss the efficiency of the chosen algorithm if the number of chocolates and students increases significantly,
Test Cases: Provide test cases to assess your solution.
Searching for a Specific Chocolate:
Task:Write a function to find the student holding a chocolate with a specified price or weight.
Assumption:The list of chocolates assigned to students is already sorted by weight or price.
Test Cases:Provide test cases to assess your solution.
Documentation and Submission:
Code Documentation: Comment on your code to explain the logic, especially in recursive functions and sorting logic.
Report:Include a brief report explaining your choice of algorithms, their efficiency, and the complexity analysis.
Submission Format:Submit the source code and the explanation in a PDF report. The text must be editable dont use images
Assumptions: make assumptions about things not written in the assignment.
Submission Guide:
Evaluation Criteria:
Correctness and Efficiency of Algorithms:The algorithms should be correctly implemented and efficient regarding time and space complexity.
Code Clarity and Documentation: Code should be readable, wellorganized, and properly documented.
Analysis and Justification: The report should justify the choices of algorithms and include a detailed complexity analysis.
The primary objective of this assignment is to foster comprehension of recursion, sorting algorithms, and searching algorithms within the context of data structures. Students are tasked with simulating a scenario involving the distribution of chocolates with varying types, weights, types, and prices to a group of students. Subsequently, they are expected to perform operations such as sorting and searching on the distributed chocolates.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started