Skip to content

In Maths folder Algorithm Added to solve Transpose of a matrix #2037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

In Maths folder Algorithm Added to solve Transpose of a matrix #2037

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Nov 19, 2020

Solved it in a better way

@@ -0,0 +1 @@
/.metadata/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add unwanted files filtering to .gitignore

Suggested change
/.metadata/
/.metadata/
*.classpath
*.project
.settings/*
*.class

@@ -0,0 +1,35 @@
package TransposeOfMatrix;

Copy link

@aravinth2094 aravinth2094 Nov 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please add documentation as per documentation standards.
Suggested change
/**
* @author Rajat Jain
* Add something about the class here, like what it does etc.
*/
  • Please format the code as per formatting and styling standards.
    You can use Online Java Formatter if you like.

public class MainClass {

public static void main(String[] args) {
int original[][]={{1,3,4},{2,4,3},{3,4,5}};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modularise this code by refactoring into a function that accepts an argument and returns the transposed result, so that this function can be used universally.

Comment on lines +9 to +16
int transpose[][]=new int[3][3]; //3 rows and 3 columns

//Code to transpose a matrix
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
transpose[i][j]=original[j][i];
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int transpose[][]=new int[3][3]; //3 rows and 3 columns
//Code to transpose a matrix
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
transpose[i][j]=original[j][i];
}
}
int transpose[][] = transposeMatrix(original);

@ghost
Copy link
Author

ghost commented Nov 20, 2020 via email

@@ -0,0 +1,35 @@
package TransposeOfMatrix;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
package TransposeOfMatrix;
package transposeOfMatrix;

@aravinth2094
Copy link

aravinth2094 commented Nov 20, 2020

Sir can you please help me because it's my first try to solve any issue through git . Can you please help me? And help me in the solving the issue or give me some advice to solve those issues . Please help me out Thanks in advance Best Regards Rajat Jain

Hi @Rajat-Jain29,

I have updated some of my comments and reviews to be more verbose. Please check them out, I believe it should help you. Please feel free to reach out.

P.S. You can commit to the same branch and this PR will automatically be updated by your push.

@ghost
Copy link
Author

ghost commented Nov 20, 2020 via email

@ghost
Copy link
Author

ghost commented Nov 20, 2020 via email

@ayaankhan98
Copy link
Member

#2041 duplicate PR

@stale
Copy link

stale bot commented Mar 20, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 20, 2021
@stale
Copy link

stale bot commented Jun 28, 2021

Please reopen this pull request once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to seek help from our Gitter or ping one of the reviewers. Thank you for your contributions!

@stale stale bot closed this Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants