Answered step by step
Verified Expert Solution
Link Copied!

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 1: Chocolate Distribution ProblemSubsequently, they are expected to perform operations such as sorting and searching on the distributed chocolates.
Weight: 5gm
Price: 2 AED
Type: Almond chocolate
ID: 002
Weight: 7 gm
Price: 4 AED
Type: Peanut butter chocolate
ID: 005
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 (e.g., 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 (don't 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, well-organized, 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions