Question: Implementation Restrictions You must use the permutation used array technique in your solution There are three tiers of credit for this program. If you can
Implementation Restrictions
You must use the permutation "used" array technique in your solution
There are three tiers of credit for this program. If you can get the code to run fast enough for then that's
worth of the points. If you can get it to run fast enough for that's worth of the points, and for
full credit, it has to run fast for
For most part of the code like for you are not allowed to use ChatGPT. You must use the permutation
code discussed in the class and modify it to solve this problem. However, for optimizing the code for or
more, you must explore how ChatGPT can help you to optimize your code and you must submit a report with
your finding that should contain:
a Your code that runs fast enough for
b Screenshot of the prompts and response from ChatGPT that helped you to improve your code to run
faster with or more.
c A short paragraph with few lines explaining how ChatGPT was able to helped you to optimize your
code.
It's completely okay if you don't find a solution that runs fast enough for You will not lose much credit.
My expectation is that students will be able to solve the problem for I am curious to see how many can
solve it for and
Your permutation must be a recursive code and should be based on the used array technique even after
optimization.
You are allowed to use only two global variables. No other global variables are allowed:
a One for array of garages
b One for the final set of permutation int array that stores the index of the garages that gave you the
minimum distance Read the problem completely and try to draw the example points provided in the sample input and s
how the result is calculated from those points, which points are finally connected to minimize the
distance.
Think, how can you use permutation and the "used" array approach to keep track which garage is us
in this process We have discussed how to perform permutations for any set objects in the permutati
lecture!. Think about, permutation of a string "CAT" could be achieved by creating permutation of t
numbers from to as the length of the string is If you get a permutation it means the
permutation is "ATC", as is the index of is the index of T and C is the index of C
Start your coding by loading the test cases and data and make sure you code is able to read them
properly before processing.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
