# Develop a python code to implement your efficient algorithm.

Computer Science

Question 1: (30 Marks)
In stores, boxes should be placed in an organized way otherwise it will be messy. Given a
collection of boxes, it is requested to place them on top of each other to reach the
minimum possible height. There is a condition, where a box cannot be placed on top of
another box unless the area of its 2D base is smaller or equal of the 2D base of the lower
box. It is allowed to rotate any box to use any two sides as its base.
For example, consider below 4 boxes where each box has the following dimensions
Input:
Box 1: (2,1,3), Box 2:(6,3,8) Box 3: (4,2,5), Box 4:(3,1,6),
Output:
From bottom to top as follows:
In the bottom Æ Box 2 on the base (6,8) and height 3,
On top of it Æ Box 3 on the base (4,5) and height 2,
Then Æ Box 4 on the base (6,3) and height 1,
Finally Æ Box 1 on the base (2,3) and height 1.
The total height is 7
[Explanation: as we can see that the first box in the bottom is the box 2 with base 6×8 and
height 3, then box3 with base 4×5 and height 2, and so on. This arrangement of boxes
fulfils the constraint mentioned above: “the dimensions of the 2D base of the lower box
are each strictly larger than those of the 2D base of the higher box”. This solution also
satisfies the shortest possible stack]
a) Describe how a brute-force approach algorithm would solve the above problem (4
marks), and explain its complexity (2 marks).
b) Design an algorithm to solve the above scenario for N boxes. (6 marks) [The
efficiency of your algorithm is the main driver of the mark], and analyze the complexity
c) Develop a python code to implement your efficient algorithm. (10 marks) [The marks
depend on the correctness of the code, indentation, comments, test-case]
d) Prepare a brief report (250 words) comparing the two algorithms (6 marks)

Question 2: (30 Marks)
There is a group of n children standing in
a queue, where their ages are listed in
the array A[ ]. The children are standing
randomly in the queue. Most probably,
their ages in the array A[ ] are randomly
listed too. For each child, you are
required to search for the next older child
in the queue and to print the difference of
their ages. Print all the outputs in an array
Out[ ].
Note:
x The last kid in the queue is then compared with the first kid in the queue as if it is a
circular queue.
x Print -1 if no one is eldest than the kid under consideration.
Example 1:
A[ ]={11, 10, 7, 13, 14, 12,
9,15,8}
Output:
Out[ ]=
{2, 3, 6, 2, 1, 3, 6, -1, 3}
Example 2:
A[]={8,5,9,4,10}
Output:
Out[ ]={1, 4, 1, 6, -1}
Explanation of example 1:
The given array A[] of heights is as follows:
A[0] A[1] A[2] A[3] A[4] A[5] A[6] A[7] A[8]
11 10 7 13 14 12 9 15 8
The kid at the starting point of the queue 11 years old (i.e.,
A[0]). The next older kid in the queue at A[3] with age 13
years. The difference between their heights is 13 – 11 = 2,
therefore 2 is printed. The second kid is 10 years old (i.e.,
A[1]) has also the same kid as the next first older kid.
Therefore 3 is printed and so on.
Remember that the queue is circular. Therefore, the last kid
in the queue with age 8 (i.e., A[8]) is compared with the kid
at the starting point of the queue, where the kid with 11
years old (i.e., A[0]) is the next older taller kid, and hence,
3 is printed.
Output: Out[ ]={2, 3, 6, 2, 1, 3, 6, -1, 3}
a) Design an efficient algorithm to solve this problem. (10 marks) [The efficiency of your
algorithm is the main driver of the mark], and analyze the complexity of your solution.
b) Develop a python code to implement your efficient algorithm. (10 marks) [The marks
depend on the correctness of the code, indentation, comments, test-case]
c) Prepare a brief report (250 words) comparing the two algorithms (6 marks)
Question 3: (30 Marks)
Given three groups of boxes A, B, and C of n boxes each, where the shapes of the boxes
are different. The capacity of each box is measured in milliliter (ml). The list of boxes’
capacities in Group A is exactly randomly repeated in Group B and C. This means that for
each box in Group A there exist a corresponding box in Group B and C that hold the same
capacity, but we do not know which box would match with the other in group A, B and C.
Your mission is to find a smart way to match these boxes.
For example:
Input: capacity in milliliter
Group 1 2 3 4 5 6 7 8
A 140 120 150 100 170 200 90 180
B 170 150 140 90 100 120 180 200
C 120 90 200 150 180 140 100 170
Output:
A[1] with B[3] with C[6]
A[2] with B[6] with C[1]
A[3] with B[2] with C[4]
… and so on
a) Using a brute-force approach, design an algorithm to solve this problem, and analyze
its complexity (3+2 marks)
b) Design a more efficient algorithm to solve this problem, and analyze its complexity
[Hint: you can use any data-structure] (6+4 marks)
c) Implement your efficient algorithm using Python (10 marks)
d) Prepare a brief report (250 words) comparing the two algorithms (5 marks)

See also  Determine True or False for each of the following statements: (a) Ensemble methods are never the cause of overfit. (b) Hyperparameters of random forests include (but not limited to) number of trees, percentage of rows sampled, and max depth.

Question 4: (30 Marks)
The following algorithm examines all the components in a given array to check for the
existence of any two numbers, where one of them is the square of the other, in the given
array or not.
For example 1: input: A[9,5,28,25,47, 55] Æ output: true
For example 2: input: A[24,15,18,18,42, 22] Æ output: false
In example 1 the output is True because (5 and 25), where 25 is the square value of 5,
while the output of example 2 is False because there is no any pair of numbers that meets
this condition.
• Input: An array A[0…n-1]
• Output: Return True if there exist any two numbers, where one of them is the square
of the other in the array, False otherwise
a) Design a brute force algorithm to solve this problem (5 marks) and analyze its
b) Design a more efficient algorithm to do the same job (10 marks) analyze the
c) Develop a python code to implement your efficient algorithm. (10 marks) [The marks
depend on the correctness of the code, indentation, comments, test-case

See also  Use one of the tools (RStudio, Python, Jupyter, RapidMiner, or Tableau) to demonstrate Predictive Analytics and explain your logic.

Custompaper.help is an academic writing platform that provides students and professionals with quality services to ease their assignment challenges. With a wide range of services, the platform has become one of the leading academic writing service providers in the market due to its reliability and affordability. Below, we shall discuss some of the services which Custompaper.help provides:

Essay Writing Service
The essay writing service provides customers with quality essays on any subject or topic they requested within a given deadline. The writers at custompaper are experts in their respective fields, and they ensure customer satisfaction by producing original content with thorough research involved backed up with strong evidence from reliable sources available online or offline. All essays come with free plagiarism reports as well as revisions if needed so that customers can trust that they are getting high-quality work for their money’s worth.

Research Paper Writing Service
This is another popular service offered by custom paper help wherein customers are assisted in conducting research papers according to their needs and requirements within specified deadlines. Writers at custom paper help have vast knowledge about various topics belonging to different disciplines such as Management, Arts & Humanities, History etc., allowing them to craft impeccable research papers every time regardless of the complexity or urgency level requested by customers. Additionally, all our research papers come along with proper citation formats which ensures customer’s safety when it comes to plagiarism issues while also helping them save time on formatting procedures thus improving overall efficiency even further!

Dissertation Writing Service
CustomPaperHelp also offers dissertation writing assistance for those who need it most – students preparing for graduation or professionals wanting to further refine their skills through higher education levels such as Master/PhD degrees etc, Our team of writers consists of experienced individuals having Master’s/PhD degrees themselves so you can rest assured that your dissertation will be handled expertly from the start till the end! Furthermore, we offer unlimited revisions until your complete satisfaction is achieved, along with regular checkups being done throughout the process just so everything goes according to course without any hiccups!

If you already have written an essay but want professional feedback before submitting it, then CustomPaperHelp also offers editing & proofreading services which helps in identifying & rectifying errors present in assignments like grammar mistakes, spelling mistakes, punctuation problems etc., thereby ensuring top-notch quality work, before submission takes place! We understand how important accuracy & consistency are when it comes to grading systems used at universities nowadays, so taking extra care during this phase becomes absolutely essential if good grades are desired afterward!

Coursework Help
For those who find coursework difficult due to complications of being quite technical in nature; CustomPaperHelp extends its support here too, by providing quality solutions every single time – starting from understanding concepts properly up until composing flawless answers following university guidelines closely enough making sure no loopholes remain whatsoever! Whether it’s related math problem-solving algorithms or lengthy home assignments – our expert panel has got you covered from head-to-toe leaving no stone unturned during this very crucial stage since final grades depend largely upon the success rate achieved here successfully!

Assignment Help
Assignments form an integral part of getting better scores & ultimately, a degree itself (in case pursuing a masters/PhD) – something only possible if precision is made a priority right away; otherwise, chances of failure increase exponentially over a time period detrimentally affecting performance evaluation systems later down road drastically hence stressing timely importance completion prior commencement other operations associated same project altogether consistently meeting high standards expected each situation respectively! Here too, CustomPaperHelp presents comprehensive solution package exceeding expectations beyond point offering optimal values therein ensuring maximum satisfaction reached under circumstances prevailing accordingly without fail…proving once more why people trust us implicitly without second thought whatsoever!!

Pages (550 words)
Approximate price: -

Why Choose Us

Quality Papers

We value our clients. For this reason, we ensure that each paper is written carefully as per the instructions provided by the client. Our editing team also checks all the papers to ensure that they have been completed as per the expectations.

Over the years, our Acme Homework has managed to secure the most qualified, reliable and experienced team of writers. The company has also ensured continued training and development of the team members to ensure that it keep up with the rising Academic Trends.

Affordable Prices

Our prices are fairly priced in such a way that ensures affordability. Additionally, you can get a free price quotation by clicking on the "Place Order" button.

On-Time delivery

We pay strict attention on deadlines. For this reason, we ensure that all papers are submitted earlier, even before the deadline indicated by the customer. For this reason, the client can go through the work and review everything.

100% Originality

At Custom Paper Help, all papers are plagiarism-free as they are written from scratch. We have taken strict measures to ensure that there is no similarity on all papers and that citations are included as per the standards set.

Our support team is readily available to provide any guidance/help on our platform at any time of the day/night. Feel free to contact us via the Chat window or support email: support@acmehomework.com.

Try it now!

## Calculate the price of your order

We'll send you the first draft for approval by at
Total price:
\$0.00

How it works?

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Our Services

Custom Paper Help has stood as the world’s leading custom essay writing services providers. Once you enter all the details in the order form under the place order button, the rest is up to us.

## Essay Writing Services

At Custom Paper Help, we prioritize on all aspects that bring about a good grade such as impeccable grammar, proper structure, zero-plagiarism and conformance to guidelines. Our experienced team of writers will help you completed your essays and other assignments.