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

java-program-to-find-smallest-number-in-an-array #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

itsarvindchandel
Copy link

java-program-to-find-smallest-number-in-an-array

java-program-to-find-smallest-number-in-an-array
for (int j = i + 1; j < total; j++)
{
if (a[i] > a[j])
{

Choose a reason for hiding this comment

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

you don't need sorting to find the smallest number just assingn first number to temp and and increment the temp when the a numeber smaller than temp is found and return the value

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.

2 participants