Nesting boxes A d-dimensional box with dimensions .x1; | StudySoup

Textbook Solutions for Introduction to Algorithms

Chapter 24 Problem 24-2

Question

Nesting boxes A d-dimensional box with dimensions .x1; x2;:::;xd / nests within another box with dimensions .y1; y2;:::;yd / if there exists a permutation on f1; 2; : : : ; dg such that x.1/ < y1, x.2/ < y2,..., x.d / < yd . a. Argue that the nesting relation is transitive. b. Describe an efficient method to determine whether or not one d-dimensional box nests inside another. c. Suppose that you are given a set of n d-dimensional boxes fB1; B2;:::;Bng. Give an efficient algorithm to find the longest sequence hBi1; Bi2 ;:::;Bik i of boxes such that Bij nests within BijC1 for j D 1; 2; : : : ; k 1. Express the running time of your algorithm in terms of n and d.

Solution

Step 1 of 3)

The first step in solving 24 problem number 2 trying to solve the problem we have to refer to the textbook question: Nesting boxes A d-dimensional box with dimensions .x1; x2;:::;xd / nests within another box with dimensions .y1; y2;:::;yd / if there exists a permutation on f1; 2; : : : ; dg such that x.1/ &lt; y1, x.2/ &lt; y2,..., x.d / &lt; yd . a. Argue that the nesting relation is transitive. b. Describe an efficient method to determine whether or not one d-dimensional box nests inside another. c. Suppose that you are given a set of n d-dimensional boxes fB1; B2;:::;Bng. Give an efficient algorithm to find the longest sequence hBi1; Bi2 ;:::;Bik i of boxes such that Bij nests within BijC1 for j D 1; 2; : : : ; k 1. Express the running time of your algorithm in terms of n and d.
From the textbook chapter Single-Source Shortest Paths you will find a few key concepts needed to solve this.

Step 2 of 7)

Visible to paid subscribers only

Step 3 of 7)

Visible to paid subscribers only

Subscribe to view the
full solution

Title Introduction to Algorithms 3 
Author Thomas H. Cormen
ISBN 9780262033848

Nesting boxes A d-dimensional box with dimensions .x1;

Chapter 24 textbook questions

×

Login

Organize all study tools for free

Or continue with
×

Register

Sign up for access to all content on our site!

Or continue with

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back