Skip to content
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

Sparse Matrix added in java Algorithms #1751

Open
wants to merge 1 commit into
base: master
from

Conversation

@sachisahu
Copy link

@sachisahu sachisahu commented Oct 12, 2020

Algorithm
STEP 1: START
STEP 2: DEFINE rows as m, cols as n, size
STEP 3: SET count = 0
STEP 4:INITIALIZE row and col of matrix
STEP 5: REPEAT STEP 9 to STEP 10 UNTIL i<rows
//for(i=0;i<rows; i++)
STEP 6: REPEAT STEP 10 UNTIL j<cols
//for(j=0;j<cols; j++)
STEP 7: if(a[i][j]==0) then count++
STEP 8: size = m*n
STEP 9: if(count>size/2) then PRINT "Yes" else PRINT "No"
STEP 10: END

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.