Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instruction : One is a word file or pdf file (both is okay). This file consists of your explanation of solution. The explanation should be

image text in transcribed

Instruction :

  1. One is a word file or pdf file (both is okay). This file consists of your explanation of solution. The explanation should be given using narrative or pseudocode, and flowchart for better explanation. A detailed explanation of your solutions such as reasoning of algorithm of choice will give better score.
  2. Another file is .c files of your solution that represent each question.

PLEASE USE C PROGRAMMING AND USE HEADER INCLUDE STDIO.H

MAKE THE CODE AS SIMPLE AS U CAN

1. (30 point) Suppose that you have a 2D array (matrix) of integer with size N*N with values of 0 (N> 2). Several elements of this matrix are inserted with another value, and the middle of this matrix is also guaranteed to have a value other than 0. Make a program to get where is (are) the nearest element(s) with same value as matrix's centroid. If more than 1 position exists near the centroid, print all the nearest elements. If no nearest element exists that has the same value with the centroid, print: "No nearest element exists". The assumption is that position 0,0 start from top leftmost matrix. For example: Input: 0020 0 0 1 ololo 00105 ooooo 0 00101 (centroid at 2.2) Output: Nearest same element is at: 1,1 Another example: Input: 0 0 2100 0 101010 0|1115 0 0000 010 007 (centroid at 2.2) Output: Nearest same elements is at: (2,3) and (2,1) Input: 00210 0 0 0 0 0 0 10 010 010 (centroid at 2,2) Output: Nearest same elements is at: no nearest element

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago