-
Notifications
You must be signed in to change notification settings - Fork 13
Feature/implementation #2
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
Open
hugocastp
wants to merge
8
commits into
chrisom79:main
Choose a base branch
from
hugocastp:feature/implementation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
59de233
Added gitignore.
hugocastp 1750ca1
Implemented methods to pass unit tests.
hugocastp 4e5ac15
Updated gitignore.
hugocastp 82edef1
Added gitignore
hugocastp 8bd52ae
Deleted generated sources.
hugocastp 680bc2c
Merge pull request #1 from chrisom79/main
hugocastp 498eb3f
Merge branch 'main' into feature/implementation
hugocastp d63239e
Updated gitignore.
hugocastp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| # From https://github.com/github/gitignore/blob/master/Gradle.gitignore | ||
| .gradle | ||
| /.gradle/ | ||
| /build/ | ||
| /.idea/ | ||
|
|
||
| # Ignore Gradle GUI config | ||
| gradle-app.setting | ||
|
|
||
| # Cache of project | ||
| .gradletasknamecache | ||
|
|
||
| # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 | ||
| # gradle/wrapper/gradle-wrapper.properties | ||
|
|
||
|
|
||
|
|
||
| # From https://github.com/github/gitignore/blob/master/Java.gitignore | ||
| *.class | ||
|
|
||
| # Mobile Tools for Java (J2ME) | ||
| .mtj.tmp/ | ||
|
|
||
| # Package Files # | ||
| *.jar | ||
| *.war | ||
| *.ear | ||
|
|
||
| # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) | ||
| !gradle-wrapper.jar | ||
|
|
||
| # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
| hs_err_pid* | ||
|
|
||
|
|
||
| # From https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore | ||
| # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | ||
| # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
|
||
| # User-specific stuff: | ||
| .idea/workspace.xml | ||
| .idea/tasks.xml | ||
| .idea/dictionaries | ||
| .idea/vcs.xml | ||
| .idea/jsLibraryMappings.xml | ||
|
|
||
| # Sensitive or high-churn files: | ||
| .idea/dataSources.ids | ||
| .idea/dataSources.xml | ||
| .idea/dataSources.local.xml | ||
| .idea/sqlDataSources.xml | ||
| .idea/dynamic.xml | ||
| .idea/uiDesigner.xml | ||
|
|
||
| # Gradle: | ||
| .idea/gradle.xml | ||
| .idea/libraries | ||
|
|
||
| # Mongo Explorer plugin: | ||
| .idea/mongoSettings.xml | ||
|
|
||
| ## File-based project format: | ||
| *.iws | ||
|
|
||
| ## Plugin-specific files: | ||
|
|
||
| # IntelliJ | ||
| /out/ | ||
|
|
||
| # mpeltonen/sbt-idea plugin | ||
| .idea_modules/ | ||
|
|
||
| # JIRA plugin | ||
| atlassian-ide-plugin.xml | ||
|
|
||
| # Crashlytics plugin (for Android Studio and IntelliJ) | ||
| com_crashlytics_export_strings.xml | ||
| crashlytics.properties | ||
| crashlytics-build.properties | ||
| fabric.properties | ||
|
|
||
|
|
||
| *.DS_Store | ||
| .AppleDouble | ||
| .LSOverride | ||
|
|
||
| # Icon must end with two \r | ||
| Icon | ||
|
|
||
|
|
||
| # Thumbnails | ||
| ._* | ||
|
|
||
| # Files that might appear in the root of a volume | ||
| .DocumentRevisions-V100 | ||
| .fseventsd | ||
| .Spotlight-V100 | ||
| .TemporaryItems | ||
| .Trashes | ||
| .VolumeIcon.icns | ||
| .com.apple.timemachine.donotpresent | ||
|
|
||
| # Directories potentially created on remote AFP share | ||
| .AppleDB | ||
| .AppleDesktop | ||
| Network Trash Folder | ||
| Temporary Items | ||
| .apdisk |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,10 +5,32 @@ | |
| public class UnidimensionalImpl implements Unidimensional { | ||
| @Override | ||
| public void ordenamiento(int[] arr) { | ||
| int len = arr.length, temp; | ||
|
|
||
| for (int i = 0; i < len; i++) { | ||
| for (int j = 1; j < (len - i); j++) { | ||
| if (arr[j - 1] > arr[j]) { | ||
| temp = arr[j - 1]; | ||
| arr[j - 1] = arr[j]; | ||
| arr[j] = temp; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| public int[] ordenamientoReversa(int[] arr) { | ||
| return null; | ||
| int len = arr.length, temp; | ||
|
|
||
| for (int i = 0; i < len; i++) { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Como se menciono en el comentario anterior, pues hacer uso de herramientas existentes de Java, puedes usar el metodo sobrecargado de Arrays.sort donde puede poner un comparator en los parametros... Arrays.sort(arr, Comparator.reverseOrder()); |
||
| for (int j = 1; j < (len - i); j++) { | ||
| if (arr[j - 1] < arr[j]) { | ||
| temp = arr[j - 1]; | ||
| arr[j - 1] = arr[j]; | ||
| arr[j] = temp; | ||
| } | ||
| } | ||
| } | ||
| return arr; | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
La logica es correcta, pero a veces puedes usar herramientas existentes como el Arrays.sort(), este hace un ordenamiento ascedente