Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. (15 points) Asymptotics. Let n = k2 for some positive integer k. A Sudoku solution is an n xn array of numbers, each in

image text in transcribed

3. (15 points) Asymptotics. Let n = k2 for some positive integer k. A Sudoku solution is an n xn array of numbers, each in the set {1,..., n}, such that the same number does not occur (1) twice in a row, (2) twice in a column, and (3) twice in a k x k square box, where the whole array is divided into n such boxes. Given an array as input, we want to determine whether it is a Sudoku solution. (a) (5 points) Give an O(n) time algorithm to solve this problem. (b) (5 points) Give an O(na) time algorithm to solve this problem. (c) (5 points) Give an N(n?) lower bound for this problem, by showing that any algorithm that makes fewer than na queries to entries of the input array cannot be correct for all possible inputs. 3. (15 points) Asymptotics. Let n = k2 for some positive integer k. A Sudoku solution is an n xn array of numbers, each in the set {1,..., n}, such that the same number does not occur (1) twice in a row, (2) twice in a column, and (3) twice in a k x k square box, where the whole array is divided into n such boxes. Given an array as input, we want to determine whether it is a Sudoku solution. (a) (5 points) Give an O(n) time algorithm to solve this problem. (b) (5 points) Give an O(na) time algorithm to solve this problem. (c) (5 points) Give an N(n?) lower bound for this problem, by showing that any algorithm that makes fewer than na queries to entries of the input array cannot be correct for all possible inputs

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

LO1 Understand human resource management and define human capital.

Answered: 1 week ago