Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file modified .gradle/7.1.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file added .gradle/7.1.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/7.1.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file added .gradle/7.1.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file added .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified build/classes/java/main/com/oracle/arrays/Multidimensional.class
Binary file not shown.
Binary file modified build/classes/java/main/com/oracle/arrays/Unidimensional.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/classes/java/main/com/oracle/arrays/model/Posicion.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="x-ua-compatible" content="IE=edge"/>
<title>Test results - MultidimensionalTest</title>
<title>Test results - UnidimensionalTest</title>
<link href="../css/base-style.css" rel="stylesheet" type="text/css"/>
<link href="../css/style.css" rel="stylesheet" type="text/css"/>
<script src="../js/report.js" type="text/javascript"></script>
</head>
<body>
<div id="content">
<h1>MultidimensionalTest</h1>
<h1>UnidimensionalTest</h1>
<div class="breadcrumbs">
<a href="../index.html">all</a> &gt;
<a href="../packages/com.oracle.arrays.html">com.oracle.arrays</a> &gt; MultidimensionalTest</div>
<a href="../packages/com.oracle.arrays.html">com.oracle.arrays</a> &gt; UnidimensionalTest</div>
<div id="summary">
<table>
<tr>
Expand Down Expand Up @@ -41,7 +41,7 @@ <h1>MultidimensionalTest</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.042s</div>
<div class="counter">0.026s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -75,8 +75,8 @@ <h2>Tests</h2>
</tr>
</thead>
<tr>
<td class="success">getDatoTest()</td>
<td class="success">0.042s</td>
<td class="success">ordenamientoTest()</td>
<td class="success">0.026s</td>
<td class="success">passed</td>
</tr>
</table>
Expand All @@ -89,7 +89,7 @@ <h2>Tests</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 7.1.1</a> at Sep 6, 2022, 10:57:32 PM</p>
<a href="http://www.gradle.org">Gradle 7.1.1</a> at 11 sep. 2022 20:09:45</p>
</div>
</div>
</body>
Expand Down
10 changes: 5 additions & 5 deletions build/reports/tests/test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h1>Test Summary</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.042s</div>
<div class="counter">0.026s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -85,7 +85,7 @@ <h2>Packages</h2>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.042s</td>
<td>0.026s</td>
<td class="success">100%</td>
</tr>
</tbody>
Expand All @@ -107,12 +107,12 @@ <h2>Classes</h2>
<tbody>
<tr>
<td class="success">
<a href="classes/com.oracle.arrays.MultidimensionalTest.html">com.oracle.arrays.MultidimensionalTest</a>
<a href="classes/com.oracle.arrays.UnidimensionalTest.html">com.oracle.arrays.UnidimensionalTest</a>
</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.042s</td>
<td>0.026s</td>
<td class="success">100%</td>
</tr>
</tbody>
Expand All @@ -126,7 +126,7 @@ <h2>Classes</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 7.1.1</a> at Sep 6, 2022, 10:57:32 PM</p>
<a href="http://www.gradle.org">Gradle 7.1.1</a> at 11 sep. 2022 20:09:45</p>
</div>
</div>
</body>
Expand Down
8 changes: 4 additions & 4 deletions build/reports/tests/test/packages/com.oracle.arrays.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h1>Package com.oracle.arrays</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.042s</div>
<div class="counter">0.026s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -78,12 +78,12 @@ <h2>Classes</h2>
</thread>
<tr>
<td class="success">
<a href="../classes/com.oracle.arrays.MultidimensionalTest.html">MultidimensionalTest</a>
<a href="../classes/com.oracle.arrays.UnidimensionalTest.html">UnidimensionalTest</a>
</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.042s</td>
<td>0.026s</td>
<td class="success">100%</td>
</tr>
</table>
Expand All @@ -96,7 +96,7 @@ <h2>Classes</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 7.1.1</a> at Sep 6, 2022, 10:57:32 PM</p>
<a href="http://www.gradle.org">Gradle 7.1.1</a> at 11 sep. 2022 20:09:45</p>
</div>
</div>
</body>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="com.oracle.arrays.UnidimensionalTest" tests="1" skipped="0" failures="0" errors="0" timestamp="2022-09-12T01:09:45" hostname="DESKTOP-M88OBDR" time="0.026">
<properties/>
<testcase name="ordenamientoTest()" classname="com.oracle.arrays.UnidimensionalTest" time="0.026"/>
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>
Binary file modified build/test-results/test/binary/results.bin
Binary file not shown.
Binary file modified build/tmp/compileJava/previous-compilation-data.bin
Binary file not shown.
Binary file modified build/tmp/compileTestJava/previous-compilation-data.bin
Binary file not shown.
19 changes: 18 additions & 1 deletion src/main/java/com/oracle/arrays/impl/MultidimensionalImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,28 @@
public class MultidimensionalImpl implements Multidimensional {
@Override
public Posicion getPosition(String[][] datos, String dato) {
Posicion pos;
//System.out.println(datos[0].length);
//System.out.println(datos[1].length);

for(int i = 0; i < datos.length ;i++){
for(int j = 0; j < datos[i].length ;j++){
if(datos[i][j] == dato){
//System.out.println(i + " + " +j);
return pos = new Posicion(1,2);
Copy link
Owner

Choose a reason for hiding this comment

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

No necesitas una asignacion aqui, sufieciente con regresar la creacion de instancia

}
}
}
//System.out.println("null");
return null;
}

@Override
public String getData(String[][] datos, Posicion posicion) {
return null;
int x = posicion.getX();
int y = posicion.getY();
String dato;
dato = datos[x][y];
return dato;
Copy link
Owner

Choose a reason for hiding this comment

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

puedes ahorra codigo solo poniendo return datos[posicion.getX(), posicion.getY()]

}
}
31 changes: 30 additions & 1 deletion src/main/java/com/oracle/arrays/impl/UnidimensionalImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,39 @@
public class UnidimensionalImpl implements Unidimensional {
@Override
public void ordenamiento(int[] arr) {
//Existen diferentes algoritmos de ordanmiento pero para este ejercicio realice el mas sencillo

int val;
//System.out.println(arr.length);
for (int i = 0;i < arr.length-2;i++){
if (arr[i]>arr[i+1]){
Copy link
Owner

Choose a reason for hiding this comment

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

Puedes ver si hay una mejora de ordenamiento con respecto a tu actual solucion, hay algoritmos mas rapidos que puedes implementar incluso Arrays.sort()

val = arr[i];
arr[i] = arr[i+1];
arr[i+1] = val;
}
}
/*
for(int i = 0; i< arr.length;i++){
System.out.println(arr[i]);
}
*/
}

@Override
public int[] ordenamientoReversa(int[] arr) {
return null;
int[] reverse = new int[4];
int j = arr.length - 1;
//System.out.println("Empieza");
for(int i = 0; i < arr.length ;i++){
reverse[i] = arr[j];
//System.out.println(reverse[i]);
j--;
}
/*
for(int i = 0; i< arr.length;i++){
System.out.println(reverse[i]);
}
*/
return reverse;
}
}