Question 1:
solution must be with recursion.
for a two dimensional array of positive integers how can I return the longest path (steps), so that the value in each cell of the longest path is from descending series of integers and the difference between each cell and cell is a given number (num).
Assumes that n is a value of the cell so (n - num) is a positive number (not zero).
can't use any loops (for,while,...etc)
the Method:
public static int longestPath(int matrix[][],int number){...
return(__overloading__);
}
For example:
int number=1;
int [][]matrix ;
matrix = new int[][]{{8, 15, 20, 33, 35},
{60, 59, 58, 32, 31},
{59, 17, 57, 56, 55},
{55, 15, 13, 58, 16}};
[login to view URL](" longestPath= "+ longestPath(matrix, num));
}
if we search for the longest path with the difference number = 1
1-in the cell matrix[0][3] the path long is 3 and the value in this path is 33 -> 32 -> 31 ends in matrix[1][4]
2-in the cell matrix[1][0] the path long is for 6 and the value in the path 60 -> 59 -> 58 -> 57 -> 56 -> 55 ends in matrix[2][4]
3-in the cell matrix[1][0] the path long is 2 and the value in this path is 60 -> 59 ends in matrix[2][0]
so the method must return the longest path witch its 6
if we search for the longest path with the difference number = 2
1-in the cell matrix[2][1] the path long is 3 and the value in this path is 17 -> 15 -> 13 ends in matrix[3][2]
the method must return the longest path witch its 3.
Hello Sir/ Ma’am
We are a group of Software Engineers having 10+ years of experience.
Expert in JAVA, C, C++ , C# , Python, ANDROID,IOS, MATLAB, IONIC.
Done 560+ projects here on FREELANCER.COM.
Please check our profile for reference.
Thank you
$30 USD en 1 día
4,8 (344 comentarios)
7,6
7,6
10 freelancers están ofertando un promedio de $26 USD por este trabajo
Hi There
I've excellent programming and development skills and knowledge. I can provide an efficient,
perfect, well documented development of your Programming and Computer project according
to 100% accuracy and requirements, with dedicated support.
Thanks
Farah Saif
Hello
My name is Ahmed, i'm a top rated freelancer.
i worked over 400 projects and over 700 hours doing java projects.
plus i passed freelancer java v3 exam with score 3.75
plus i got 2 java certificate 1Z0-803 and 1Z0-804 with 3+ years experience.
small overview of feedback on my profile
"you want to get your projects completed with quality? Hire Ahmed. Highly recommended."
"Thoroughly satisfied with Ahmed, and would recommend him to anyone looking for an excellent java developer!"
"Highly recommended. Very smart and well experience"
looking forward to work with you
Regards
HI, I'm an experienced programmer.
I'm interested in your task and would like to do it. I'm available so contact me anytime to get started..................... Thanks.
Hello, I've read your requirements for recursive solution, I can do this for you, feel free to contact me and ask anything regarding this. Hope you will get what you want.
Thank You
I have 5+ years of Java experience. I have read the description. I can start immediately and deliver you r code in couple of hours. Hope we can work together.
hello sir
I have good experience in java under both windows and Linux
I compile java code with cmd or terminal and I use eclipse and netbeans
this project easy for me
when I complete it you can check and then you can accept my bid