Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

which we Homework Given the layout of a rectangular apartment as a grid, with some cells free and some blocked, determine the largest table that

image text in transcribed
which we Homework Given the layout of a rectangular apartment as a grid, with some cells free and some blocked, determine the largest table that can be placed in the apartment, where largest is the largest perimeter of the table. The table must have its edges parallel to the edges of the apartment You are given nr and nc, the number of rows and columns in the apartment layout, and a 2-dimensional character array showing free squares as Y And blocked squares as "X". Return the largest possible perimeter for the table. Try to make your code efficient and explain your big-O analysis of your algorithm. I give your pseudocode and its big analysis. You can use maxinc.nr) as the size of the problem in your bigo Example2 22 The largest perimeter is 8 XXX XX The largest perimeter is 10 a 1x4 table fits in the second column) X.X X.X The largest perimeter is 4 Given n the number of gophers nh the number of 1-gopher holes, time the number of seconds before death v the speed of each gopher the x y coordinates of each gopher, and the x y coordinates of each hole. Return the number of gophers that can be saved when the gopher community uses its optimum strategy [if you make a graph and use a standard graph algorithm, be specific about how you are making the graph. You can just invoke a standard graph algorithm as part of your pseudocode - you don't need to give details but you DO have to show what you are passing to it and what you are getting back. Your big O analysis should include both the stuff your pseudocode does directly and the work done by the standard graph algorithm.] in nh time y followed by n gopher locations, then nh hole locations) Example 2 2 5 10 1.0 1.0 2.0 2.0 100.0 100.0 20.0 20.0 1 gopher can be saved from the flock of eagles (but there is no way to save more than 1)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions

Question

=+Does it exceed the promises or underdeliver?

Answered: 1 week ago

Question

How is the NDAA used to shape defense policies indirectly?

Answered: 1 week ago