Question
for this question: a greedy search that must check all meaningful line combinations that could build a regular triangle. Finally, the code must return the
for this question: a greedy search that must check all meaningful line combinations that could build a regular triangle. Finally, the code must return the lines of the triangle that has longest perimeter.
any programing language would do
but please write a report that includes:
an Online link to see and to run the codes on an online compiler site which has no access problems.
Explanations about the methods/approaches used and the code logic.
Calculations of the worst, best and average case time complexities and final representations using big-O, big- and big- notations.
QUESTION 2- Given an array of line lengths, please write a function that chooses 3 of the lines to construct a regular triangle with the maximum possible perimeter. Return an array of the lengths of triangle sides as integers. Signature of the function could be: public List maxPerimeterTriangle(List lines) \{ \} Sample: For instance, if the list of lines would be [1,2,3,4,5,10] the function must return the line list [3,4,5] since this combination gives the maximum perimeter lengthStep 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