Question
Consider a 3D stack of blocks; each block is a cube given as eight [x; y; z] coordinates. Assume that all cubes are the same
Consider a 3D stack of blocks; each block is a cube given as eight [x; y; z] coordinates. Assume that all cubes are the same size. A con guration is valid i : There is at least one block on the " oor" (i.e., the x axis is zero for one of its faces) Every other block is lying exactly on top of another block, such that there is a path to a oor block (i.e., the blocks are stacked, not oating in mid-air). Let isValid(A) be a function that takes in an n8 array and outputs whether or not it consists of a valid con guration. (a) (10 pts) Write pseudocode for a sequential version of isValid (b) (15 pts) Write pseudocode for a parallel version of this algorithm. Assume that you have as many processors available as needed. (c) (15 pts) Analyze (i.e., prove) the running time of both algorithms and the work of the parallel one (d) Extra credit (15 pts): Assume that the cubes can have di erent sizes. Write pseudocode for a parallel algorithm that can solve this problem this version of the problem. Here, a cube is considered supported i it lies completely on top of another one (i.e., a big cube cannot lie on top of a smaller one). Note that the most ecient algorithms (relative to others in the class) will receive full marks; less ecient ones will be marked dow
Step 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