Reference no: EM13712071
You need to prepare a matrix.
Program- Take an N x N matrix, and create a new, (N-1) x (N- 1), matrix with each element being the sum of four nearby elements. You need to figure out a way to break the matrix up into squares and iterate through the matrix, while staying within its bounds. For example:
0 1 2
3 4 5
6 7 8
Result:
8 12
20 24
You have to implement an iterative calculate_result() function that takes the original N x N array and fills the result array with the correct sum of the four neighboring elements, and also, you require a recursive_calculate_result() function that does the same thing as calculate_result but recursively.
Requirements for your program:
- Read the N value from the user
- Initialize the N x N array
- Print the initial array and the resulting array
- All functions (including main) must not be more than 15 lines of code!!!
Can someone please help me. I don't know what to do to write this C program.
What is the mass of the star it orbits around
: Two planets P1 and P2 orbit around a Star S in circular orbits with speeds v1=42.86 km/s, and v2=56.2 km/s respectively.
|
What would be the pseudocode and flowchart
: What would be the pseudocode and flowchart for this problem? BTW it shows Fibonacci numbers below 100.
|
Find how many strings in a have exactly three 5s
: Let A be the set of all strings of decimal digits of length five. For example, 00312, 99999, and 19483 are strings in A.
|
Create a gui message panel that uses 4 different fonts
: Create a GUI message panel that uses 4 different fonts, colors and styles ( bold ect ) with messages of your choice.
|
Print the initial array and the resulting array
: Take an N x N matrix, and create a new, (N-1) x (N- 1), matrix with each element being the sum of four nearby elements. You need to figure out a way to break the matrix up into squares and iterate through the matrix, while staying within its bound..
|
Splay tree and show the resulting tree
: Insert 5, 1, 3, 6, 2, 4 into an initially empty splay tree and show the resulting tree - Can you provide some help with my Java language project? I hope someone nice out there can help me with it.
|
Write class encapsulating the concept of weather forecast
: Write a class encapsulating the concept of the weather forecast, assuming that it has the given attributes: the temperature and the sky conditions, which could be sunny, snowy, cloudy, or rainy.
|
Computes a students grade for an assignment
: Write a C++ program that computes a student's grade for an assignment as a percentage given the student's score and total points.
|
Construct minimal avl trees of height
: Construct minimal AVL trees of height 0, 1, 2, 3, and 4. you do not need to fill in the values, just draw the structure of the tree. Tip: Use the recursive definition for the number of nodes in a minimal AVL tree.
|