elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


  Mostrar Mensajes
Páginas: [1] 2
1  Seguridad Informática / Hacking / aun se pueden encontrar cursos avanzados de hacking etico en la red? en: 18 Junio 2020, 02:14 am
DE CASUALIDAD ALGUNO TIENE ENLACES O LIBROS, O PDF, QUE ME PUEDAN FACILITAR, PORQUE TENGO UNOS PERO CREO QUE SON MUY VIEJOS ,Y PUEDO CONSIDERARLOS OBSOLETOS
2  Programación / Programación General / Ayuda Con Este ERROR, GRAFOS en: 25 Febrero 2020, 03:04 am
BUENO EXPLICO MI CASO, ESTOY INTENTANDO HACER UNA FUNCION QUE ME INSERTE UNA ARISTA  PARA HACER UN BFS ,ESTA MI FUNCION Y CUANDO LO LLAMO EN EL MAIN CON DO WHILE, LO QUE SUCEDE ES QUE CUANDO QUIERO INSERTAR UNA ARISTA DE UN VERTICE A OTRO , ME SALE QUE EL PROGRAMA DEJO FUNCIONAR, ENTONCES NOSE SE TENGO ALGUN ERROR AL CODIFICAR O UN ERROR LOGICO, POR FAVOR UN ILUMINADO QUE ME AYUDE A RESOLVER ESTE DILEMA

Código
  1. void Grafo::InsertarArista(Vertice *origen, Vertice *destino)
  2. {
  3. Arista *nueva = new Arista;
  4. nueva->sig=NULL;
  5. nueva ->ady=NULL;
  6.  
  7. Arista *aux;
  8. aux = origen->ady;
  9.  
  10. if(aux==NULL)
  11. {
  12. origen->ady = nueva;
  13. nueva->ady = destino;
  14. }
  15. else
  16. {
  17. while (aux !=NULL)
  18. {
  19. aux=aux->sig;
  20.  
  21.  }
  22.  
  23.  aux->sig = nueva;
  24.  nueva->ady=destino;
  25.  }
  26. }



Código
  1. case 2:
  2.        {
  3.            string origen, destino;
  4.            system("cls");
  5.            if(G.vacio())
  6.            {
  7.                cout<<"El grafo esta vacio"<<endl;
  8.            }
  9.            else
  10.            {
  11.                cout<<"Ingrese del nombre del vertice origen: ";
  12.                cin.ignore();
  13.                getline(cin, origen, '\n');
  14.                cout<<"Ingrese el nombre del vertice destino: ";
  15.                getline(cin, destino, '\n');
  16.                system("cls");
  17.  
  18.                if(G.GetVertice(origen) == NULL || G.GetVertice(destino) == NULL)
  19.                {
  20.                    cout<<"Uno de los vertices no es valido"<<endl;
  21.                }
  22.                else
  23.                {
  24.                    G.InsertarArista(G.GetVertice(origen), G.GetVertice(destino));//, peso);
  25.                }
  26.            }
  27.            cin.get();
  28.            cin.get();
  29.            break;
  30.        }
3  Programación / Programación General / Re: Codigo para saber si este grafo es conexo en: 20 Septiembre 2019, 00:45 am
me has dejado mas perdido desde que arranque, me dices una cosa y luego otra , no logro entender que es lo que me quieres decir , solo necesito saber que correcciones hago puntualmente, porque tus explicaciones no me quedan muy claras
4  Programación / Programación General / Re: Codigo para saber si este grafo es conexo en: 19 Septiembre 2019, 18:58 pm
BUENO YA COMPILE Y TODO PERFECTO, PERO LA MATRIZ QUE LE INGRESE ES DE UN GRAFO CONEXO , ENTONCES NO ENTIENDO PORQUE SALIO EL FALSE, ME PERDI EN ESTA PARTE , que hize mal o pase por alto alguna cosa?

Código
  1. package matriz_adyacencia;
  2.  
  3.  
  4.  
  5. /**
  6.  *
  7.  * @author USUARIO
  8.  */
  9. public class Matriz_Adyacencia {
  10.  
  11.    /**
  12.      * @param args the command line arguments
  13.      */
  14.    public static void main(String[] args) {
  15.        Matriz_de_adyacencia matriz = new Matriz_de_adyacencia(5);
  16.         Matriz_de_adyacencia Conexion  =  new Matriz_de_adyacencia(5);
  17.               Conexion.esConexoo();
  18.           System.out.println(Conexion.esConexoo() );
  19.  
  20.        matriz.agregar(0, 1);
  21.        matriz.agregar(0, 1);
  22.        matriz.agregar(0, 2);
  23.        matriz.agregar(0, 3);
  24.  
  25.        matriz.agregar(1, 0);
  26.        matriz.agregar(1, 0);
  27.        matriz.agregar(1, 4);
  28.  
  29.        matriz.agregar(2, 0);
  30.        matriz.agregar(2, 3);
  31.        matriz.agregar(2, 4);
  32.  
  33.        matriz.agregar(3, 0);
  34.        matriz.agregar(3, 2);
  35.  
  36.        matriz.agregar(4, 1);
  37.        matriz.agregar(4, 2);
  38.        matriz.agregar(4, 4);
  39.        matriz.agregar(4, 4);
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.        matriz.imprimir();
  48.  
  49.  
  50.  
  51.  
  52.  
  53.    }
  54.  
  55.  
  56.    }

Código
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package matriz_adyacencia;
  7.  
  8.  
  9. public class Matriz_de_adyacencia {
  10.  
  11.    public int n;
  12.    public int[][] matriz;
  13.  
  14.    /**
  15.      * Constructor de clase
  16.      * @param n numero de nodos
  17.      */
  18.    public Matriz_de_adyacencia(int n) {
  19.        this.n = n;
  20.        matriz = new int[this.n][this.n];
  21.        //se inicializa matriz en 0
  22.        for(int i=0; i< n; i++){
  23.            for(int j=0; j< n; j++){
  24.                matriz[i][j] = 0;
  25.            }            
  26.        }
  27.    }
  28.  
  29.    public void agregar(int i, int j){
  30.        matriz[i][j] += 1;
  31.    }
  32.  
  33.    public void remover(int i, int j){
  34.        if(matriz[i][j]>0)
  35.            matriz[i][j]-= 1;
  36.    }
  37.  
  38.    public void imprimir(){
  39.        for(int i=0; i< n; i++){
  40.            for(int j=0; j< n; j++){
  41.  
  42.  
  43.                System.out.print( matriz[i][j] + "  " );        
  44.  
  45.            }
  46.            System.out.println("");
  47.  
  48.        }  
  49.    }
  50.  
  51.   public  boolean esConexoo(){
  52.       boolean conexoo=true;
  53.       for(int i=0;i<matriz.length;i++){
  54.           for(int j=0;j<matriz.length;j++){
  55.  
  56.               if(i!=j && matriz[i][j]==0){
  57.                   conexoo = false;
  58.                break;
  59.  
  60.           }
  61.  
  62.  
  63.       }
  64.  
  65.  
  66.  
  67.   }
  68.       System.out.println(conexoo);
  69.        return false;
  70.  
  71. }
  72. }
  73.  
  74.  
  75.  
  76.  
  77.  
5  Programación / Programación General / Re: Codigo para saber si este grafo es conexo en: 19 Septiembre 2019, 17:24 pm
SUPONGO QUE ASI ESTARIA BUENO, AHORA SOLO FALTA LLAMAR LA FUNCION EN EL mAIN Y LISTO CREERIA YO, O FALTA alguna cosa?

otra cosa que no tengo muy clara, SI RETORNA FALSE=NO CONEXO Y SI RETORNA TRUE=CONEXO?

Y COMO PUEDO COMPROBARLO SI ME FUNCION, SUPONIENDO QUE TENGO TODO EL CODIGO HECHO

Código
  1. public  boolean esConexoo(){
  2.       boolean esConexoo=true;
  3.       for(int i=0;i<matriz.length;i++){
  4.           for(int j=0;j<matriz.length;j++){
  5.               if(i!=j && matriz[i][j]==0){
  6.                   esConexoo = false;
  7.                   break;
  8.               }
  9.  
  10.           }
  11.       }
  12.  
  13.        System.out.println(esConexoo);
  14.        return false;
  15.   }
6  Programación / Programación General / Re: Codigo para saber si este grafo es conexo en: 19 Septiembre 2019, 02:53 am
Entonces tendría que hacer otro ciclo que me vaya comparando los componentes de cada fila y de cada columna y que me diga si es cero o uno, y que los guarde en algun lado?

entonces tengo que crear otra funcion void recorrergrafo y que esa misma me diga si es conexo o no?
7  Programación / Programación General / Codigo para saber si este grafo es conexo en: 18 Septiembre 2019, 18:41 pm
ESTE ES MI CODIGO LE INGRESO UNA MATRIZ DE NxN de un GRAFO NO DIRIGIDO, LO QUE NECESITO QUE ME AYUDEN ES COMO HAGO PARA RECORRER ESA MATRIZ Y DECIR SI EL GRAFO ES CONEXO O NO


TEORIA GRAFO CONEXO
un grafo es conexo si existe un camino de un nodo hacia cualquier otro nodo del grafo

Código
  1. package matriz_adyacencia;
  2.  
  3.  
  4.  
  5. /**
  6.  *
  7.  * @author PAPAYO
  8.  */
  9. public class Matriz_Adyacencia {
  10.  
  11.    /**
  12.      * @param args the command line arguments
  13.      */
  14.    public static void main(String[] args) {
  15.        Matriz_de_adyacencia matriz = new Matriz_de_adyacencia(5);
  16.  
  17.  
  18.        matriz.agregar(0, 1);
  19.        matriz.agregar(0, 1);
  20.        matriz.agregar(0, 2);
  21.        matriz.agregar(0, 3);
  22.  
  23.        matriz.agregar(1, 0);
  24.        matriz.agregar(1, 0);
  25.        matriz.agregar(1, 4);
  26.  
  27.        matriz.agregar(2, 0);
  28.        matriz.agregar(2, 3);
  29.        matriz.agregar(2, 4);
  30.  
  31.        matriz.agregar(3, 0);
  32.        matriz.agregar(3, 2);
  33.  
  34.        matriz.agregar(4, 1);
  35.        matriz.agregar(4, 2);
  36.        matriz.agregar(4, 4);
  37.        matriz.agregar(4, 4);
  38.  
  39.  
  40.  
  41.        matriz.imprimir();
  42.  
  43.  
  44.  
  45.  
  46.  
  47.    }
  48.  
  49.  
  50.    }


Código
  1. package matriz_adyacencia;
  2.  
  3. public class Matriz_de_adyacencia {
  4.  
  5.    public int n;
  6.    public int[][] matriz;
  7.  
  8.    /**
  9.      * Constructor de clase
  10.      * @param n numero de nodos
  11.      */
  12.    public Matriz_de_adyacencia(int n) {
  13.        this.n = n;
  14.        matriz = new int[this.n][this.n];
  15.        //se inicializa matriz en 0
  16.        for(int i=0; i< n; i++){
  17.            for(int j=0; j< n; j++){
  18.                matriz[i][j] = 0;
  19.            }            
  20.        }
  21.    }
  22.  
  23.    public void agregar(int i, int j){
  24.        matriz[i][j] += 1;
  25.    }
  26.  
  27.    public void remover(int i, int j){
  28.        if(matriz[i][j]>0)
  29.            matriz[i][j] -= 1;
  30.    }
  31.  
  32.    public void imprimir(){
  33.        for(int i=0; i< n; i++){
  34.            for(int j=0; j< n; j++){
  35.                System.out.print( matriz[i][j] + "  " );        
  36.            }
  37.            System.out.println("");
  38.  
  39.        }  
  40.    }
  41.  
  42.  
  43.  
  44.  
  45. }

ESPERO QUE ME AYUDEN GRACIASS
8  Programación / Programación C/C++ / Codigo Grafos C++ en: 5 Septiembre 2019, 20:49 pm
sabe alguno comO implementar o como programar esto,SON GRAFOS

1. (Si UN GRAFO es completamente conexo.
2. (Si tiene camino o circuito de Hamilton o ambos
3. (Si tiene camino o circuito de Euler o ambos
4. ( Ingresar los datos de dos vértices e indique cual es el camino más cortos entre
ellos.
9  Programación / Programación General / Como se hace este autómata, alguien que me de una solucion en: 28 Marzo 2019, 00:20 am
HE BUSCADO EN VARIAS PARTES Y NO HE PODIDO DAR CON UNA SOLUCION


 :-( :-(

->Construya el AFN que reconozca el lenguaje de todas las cadenas en base 3 que pueden
iniciar en 00 o 22, deben contener 021 y terminar en 11, posteriormente conviertalo en un AFD. Dibuje
los automatas y muestre la tabla de transicion de estados, as como el proceso de conversIon.


-> Es posible construir un AFN con 3 estados que reconozca el lenguaje vacIo?
10  Programación / Programación C/C++ / Re: Algoritmo de marshall en: 23 Marzo 2019, 05:02 am
no se ni como empezar , a implementar  ese algoritmo vi explicaciones de como hacerlo , pero no orientado para programarlo, osea que aprendi como hacerlo,, pero no como programarlo
Páginas: [1] 2
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines