In this assignment, you will design an algorithm to arrange paintings
in a display.
The Western Reserve Auction House has been asked to carry out the
auction of paintings by Picasso and Dalí. As an intern at the Auction
House, you are tasked to design an algorithm to arrange the
paintings so that they can be viewed in the days leading to the
auction. The curators have given you the following rules:
• The paintings will be arranged in two rows, with the Picassos
in front and the Dalís in the back. Each Dalí has exactly one
Picasso in front of it, and each Picasso has exactly one Dalí
• The Picasso (in front) must be shorter than the Dalí (behind
• The paintings should be arranged in non-decreasing order of
price from the left to the right. Paintings of the same price can
be arranged in any order as long as the Picasso is shorter than
• There are n Picassos and n Dalís.
• As many paintings should be displayed as allowed by the
previous rules. It is possible that the rules do not allow any
display, in which case the algorithm should say so.
Your algorithm should be correct and as fast as you can make it.
However, the curators did not give you any explicit run time target.
• An overview of the algorithm with a narrative section and
• The pseudo-code of your algorithm. You should state the
classes to which each method belongs and explain the
abstraction that your classes and your methods capture,
• A justification for the algorithm’s correctness,
• An analysis of its running time, and
• A few examples of the algorithm operation.
It is your job to specify the representation and format of the
arguments, such as the heights and prices of the paintings. Your
submission will be evaluated in part on the adherence of argument
representation to good craftsmanship principles. Your algorithm
should be written as a flexible package that can be reused in other
projects, and thus should avoid using any explicit form of input and
No implementation is required: you will implement your pseudo-
code in the next programming assignments. After this assignment,
you will not be allowed to make major changes to the pseudo-code.
Although it is only required for the programming assignment 7, you
can start early with the installation of the CSDS 293 development
environment. The server environment is described on Canvas in the
git module under “Server Setup”. Please, note that the CSDS 293 staff
does not support Windows: alternative options are covered on
Canvas in the Syllabus section under “Windows”.
A module (Pseudocode Examples) contains a cheat sheet and five
examples of pseudo-code from various textbook.
The class discussion will focus on the pseudo-code. The pseudo-code
must be of sufficiently good quality that you can easily generate code
from it in the next programming assignment. You may also be
required to walk through your pseudo-code on some examples.
Rather than submitting incorrect pseudo-code, it is preferable that
you clearly specify a subset of requirements and complete the
assignment correctly for these requirements.
EasyDue™ 支持PayPal, AliPay, WechatPay, Taobao等各种付款方式!
E-mail: firstname.lastname@example.org 微信:easydue