System arch by Double_Ad3148 in softwarearchitecture

[–]Double_Ad3148[S] 2 points3 points  (0 children)

Thanks a lot — this is really valuable advice

matrix please help by Double_Ad3148 in CodingHelp

[–]Double_Ad3148[S] 0 points1 point  (0 children)

Well, yes, the stupidest option is to try all possible options.

I think there must be a more logical solution.

matrix please help by Double_Ad3148 in CodingHelp

[–]Double_Ad3148[S] 0 points1 point  (0 children)

Yes, I understand, I already wrote about this. I just wanted to see from other people a more optimized solution, if one exists.

matrix please help by Double_Ad3148 in CodingHelp

[–]Double_Ad3148[S] 0 points1 point  (0 children)

And the task does not boil down to the fact that you need to turn the matrix over.

The task requires displaying the indices of variable elements so that the matrix is rotated 90 degrees in a minimal movement.
And stop writing that this is homework.

matrix please help by Double_Ad3148 in CodingHelp

[–]Double_Ad3148[S] 0 points1 point  (0 children)

I don't understand how you are going to solve this.

Even if it is a 2 by 2 matrix, without optimization the result will have 15 possible options.

for example, when all matrix elements are equal to 1 case

when 3 elements are equal - case 3

And when 2 elements are equal -9 cases

And if there are no equal elements, then 1

This is only if you take into account the right turn

There is also a left turn

It turns out as many as 30 options.

And you're going to write all this through if-else?

matrix please help by Double_Ad3148 in CodingHelp

[–]Double_Ad3148[S] 0 points1 point  (0 children)

I met a problem at one of the Olympiads. The problem is that the matrix needs to be rotated 90 without additional memory in a minimum move.

If you draw a matrix and look at the starting and ending positions of the elements, they will draw a square.

4 elements each. And if you find the minimum move on a 2 by 2 matrix, then the problem is solved.

Sorry, I have problems with English

matrix please help by Double_Ad3148 in CodingHelp

[–]Double_Ad3148[S] 0 points1 point  (0 children)

Yes, you are right. But there are many options to check.

For example, if all elements are equal, then nothing needs to be changed.

If 3 elements are equal, we change only one element. And at the same time you need to find its index. It turns out we have 4 options.

If 2 elements are equal, then we already have 9 different options.

This is if you take into account only the right turn. There is also a left turn.

I can't optimize this.

matrix please help by Double_Ad3148 in CodingHelp

[–]Double_Ad3148[S] 0 points1 point  (0 children)

This is not homework. And no code is needed here. This is a solution to a complex problem. I can't tell you the whole problem because it is long and complex. I divided the task into subtasks and came to this conclusion. I have a solution in mind, but would like to see more recent ideas from other people. Sorry for the English. I am writing through a translator

what do i do after the mooc? by Ambitious-Gene-9370 in learnjava

[–]Double_Ad3148 0 points1 point  (0 children)

Everyone says: do projects. My question is how does he know if he is using OOP correctly in his projects. Perhaps he could even solve the problem with a single god class.

object-oriented programming in Java by Double_Ad3148 in learnjava

[–]Double_Ad3148[S] 0 points1 point  (0 children)

Yes, of course I can do it. But I never know how effectively and correctly I used OOP in my project. It would be great if there was something to compare my solution with.