Children’s toymaker AlgosRUs is creating a stacking puzzle where n oddly shaped discs need to be…

Children’s toymaker AlgosRUs is creating a stacking puzzle where n oddly shaped discs need to be placed on k pegs, and has employed you to help with the task. Each disc can either be placed directly on a peg or must be placed on top of another disc that is strictly larger than it in all directions. Your task is to decide whether it given shapes can be assembled into k “stacks” to be placed on the pegs. As input to the problem, you are given an n x n matrix C, where for all i, j — 1 if disc i can be placed on disc j and — 0 otherwise. You can assume that the given matrix represents a collection of shapes that are physically possible. Given n, C, and k as input, your goal is to design an algorithm that will output “Yes” if a feasible arrangement of the 7/ discs on k pegs exists, and “No” otherwise. For example, suppose that n = 4 and the matrix C is given by:

Attachments:

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

 

"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"