# Ece 175: computer programming for engineering applications

ECE 175: Computer Programming for Engineering Applications

Homework Assignment 7

Conventions: Name your C programs as hwx py.c where x corresponds to the homework number and y corresponds

to the problem number. As an example the C program for hw1 problem 1 should be named as hw1 p1.c. Write

in at least the following info should be included

– Author:

– Date created:

– Brief (two-line) description of the program:

Submission Instructions: Use the dropbox on D2L to submit only the .c les.

Problem 1: The les in sudoku.zip contain integer values for Sudoku puzzles (two dimensional integer arrays with

9 rows and 9 columns). Write a program that reads a sudoku le as input and prints out if the le is a proper

solution to the Sudoku puzzle.

For the rules of Sudoku, check Wikipedia: http://en.wikipedia.org/wiki/Sudoku.

Example of a correct Sudoku puzzle:

1 2 3 4 5 6 7 8 9

4 5 6 7 8 9 1 2 3

7 8 9 1 2 3 4 5 6

2 3 4 5 6 7 8 9 1

5 6 7 8 9 1 2 3 4

8 9 1 2 3 4 5 6 7

3 4 5 6 7 8 9 1 2

6 7 8 9 1 2 3 4 5

9 1 2 3 4 5 6 7 8

Problem 2: Insertion Sort is a sorting algorithm that moves the elements of an array to their correct position

one element at a time. The following example shows the steps for sorting array data= [3, 7, 4, 9, 5, 2, 6, 1]. In

each step, the item under consideration is underlined. The array before the underlined element is already sorted

while the array after the underline element is unsorted. The item that is moved (or left in place because it was the

biggest yet considered) to the correct position within the sorted part of the array. The new position of the element

that was moved in the previous step, appears in bold in the next step.

3 7 4 9 5 2 6 1

3 7 4 9 5 2 6 1

3 7 4 9 5 2 6 1

3 4 7 9 5 2 6 1

3 4 7 9 5 2 6 1

3 4 5 7 9 2 6 1

2 3 4 5 7 9 6 1

2 3 4 5 6 7 9 1

1 2 3 4 5 6 7 9

1

Develop C code that would implement the Insertion Sort algorithm. Your code should use the following functions

void insertion(int x[ ], int size)

void print ar(int x[ ], int size)

void swap(int *a, int *b)

The last two functions are already provided in the class notes.

Submit your .c les named hw7 p1.c and hw7 p2.c via D2L dropbox

2

## Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors:
Number of pages
Urgency
Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

# Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

### Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

### Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

### Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.