Documente Academic
Documente Profesional
Documente Cultură
Facultad de ingeniería
Asignatura:
Diseño de Software
NRC: 2363
Docente
ING. OSCAR NAVARRO
Presentado por:
Febrero 2020
Bogotá
ÍNDICE
1. Introducción
2. Objetivo
3. Descripción
4. Desarrollo
_________________________________________________________________________
1. Introducción
2. Objetivo
3. Descripción
4. Desarrollo
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package recursividad;
import java.util.Scanner;
/**
*
* @author Nicolas Tellez
*/
public class Recursividad {
printmat(matriz);
Al hacer pruebas con este problema con variables pequeñas me da una respuesta rápida
pero cuando lo aumentó tarda un poco más, cabe afirmar que el computador de tiene el
mejor hardware.
El resultado se dio en 4 segundos pero duplicado el tamaña de la matriz tenemos este
resultado:
Clase Cmatrices
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Clases;
/**
*
* @author Nicolas Tellez
*/
public class Cmatrices {
if (matriz.length == 2) {
double deter = matriz[0][0] * matriz[1][1] - matriz[0][1] * matriz[1][0];
return deter;
} else {
double deter = 0;
return deter;
}
int count1 = 0;
int count2 = 0;
count1++;
}
return temp;
tempAdjunta[i][j] = elementoAdjunto;
return tempAdjunta;
tempTranspuesta[i][j] = matriz[j][i];
}
}
return tempTranspuesta;
Clase Matrices
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package matrices;
import Clases.Cmatrices;
import java.util.Scanner;
/**
*
* @author 2012
*/
public class Matrices {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner leer = new Scanner(System.in);
int tamaño = 0;
int i, j;
do {
System.out.print("Digite el tamaño de la matriz: ");
tamaño = leer.nextInt();
if (tamaño < 0 || tamaño == 1) {
System.out.println("Dato invalido");
}
} while ((tamaño < 0) || (tamaño == 1));
try {
System.out.println("");
}
System.out.println("la determinante es:" + determinate);
if (determinate == 0) {
} catch (Exception e) {
System.out.println("error->" + e.getMessage());
}