Added base conversions. by shivhek25 · Pull Request #17 · TheAlgorithms/Java · GitHub
Skip to content

Added base conversions.#17

Closed
shivhek25 wants to merge 5 commits into
TheAlgorithms:masterfrom
shivhek25:master
Closed

Added base conversions.#17
shivhek25 wants to merge 5 commits into
TheAlgorithms:masterfrom
shivhek25:master

Conversation

@shivhek25

Copy link
Copy Markdown
Contributor

No description provided.

@dynamitechetan

Copy link
Copy Markdown
Member

@mrdjohnson mrdjohnson left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hopefully marked some compile and runtime errors. Also the code style here is based on C#, would suggest following the Java style guide (or just using Jetbrains' IDEA's auto formatting).

Comment thread Bubble Sort.java Outdated
{
int array[]=new int[6];
int n;
int array[]=new int[n];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"n" has no value here, this will break

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made the changes.

Comment thread Bubble Sort.java Outdated
Scanner input=new Scanner(System.in);

System.out.println("Enter length of array:");
n=sc.nextInt();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

now that n has a value we can initialize the "array" variable down here

int a[]={'A','B','C','D','E','F'};
n=sc.nextInt();
k=n;
while(k!=0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

infinite while loop, the value of k is never modified

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated it.

@AnupKumarPanwar AnupKumarPanwar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The statement number 8 needs to be placed after 11th statement.

@shivhek25

Copy link
Copy Markdown
Contributor Author

Made the requisite changes. Kindly check.

@shivhek25

Copy link
Copy Markdown
Contributor Author

Can the admins and reviewers please look into the updations ? Thank you. @dynamitechetan @DocJava @AnupKumarPanwar

@mrdjohnson

Copy link
Copy Markdown

Looks fine, I would suggest using readable variable names (instead of i k n j or other random letters).
I still vote taking a look at the Java code style guide https://google.github.io/styleguide/javaguide.html
The GCD file (looks fine, I did not run it, but here are some notes):
-The main method throws exception , but the entire code is caught in a try catch..so nothing would ever be thrown.
-I'm pretty sure the try catch would never actually catch anything?
-The catch has "return" in it, but it is the last thing to happen in a block, so really you could just leave it empty or something and have the same effect?

@shivhek25

Copy link
Copy Markdown
Contributor Author

Sure. Should I change the variable names for these codes as well, or should I keep this pointer in mind next time onwards ? @DocJava

@mrdjohnson

Copy link
Copy Markdown

That is up to you, the coder. (I vote to change it now though)

@r0hit-gupta

Copy link
Copy Markdown
Member

@shivhek25 Please resolve the conflicts.

@shivhek25

Copy link
Copy Markdown
Contributor Author

I have already made all the changes. Could you please specify which conflicts are to be resolved ?

@0oo0

0oo0 commented Aug 13, 2017

Copy link
Copy Markdown

There are conflicts in BubbleSort.java
You can see them on Github.
Merge conflicts arise when you compete for the same line change by different branches.
Try this
https://help.github.com/articles/resolving-a-merge-conflict-on-github/

@shivhek25

Copy link
Copy Markdown
Contributor Author

The resolve conflicts is deactivated so I followed the instructions on how to resolve the error using cmd. After having done those, the file is still under conflict.

@dynamitechetan

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants