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

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


  Mostrar Temas
Páginas: [1]
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 / 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
4  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.
5  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?
6  Programación / Programación C/C++ / El Mismo problema de siempre en: 21 Marzo 2019, 05:03 am
Algun alma caritativa que me ayude a Encontrar el Error ;D ;D


C:\Users\USUARIO\Desktop\collect2.exe   [Error] ld returned 1 exit status
 
Código
  1. #include<iostream>
  2. #include<conio.h>
  3. #include<stdlib.h>
  4. using namespace std;
  5.  
  6. struct nodo {
  7. int dato;
  8. nodo * der;
  9. nodo* iz;
  10. };
  11.  
  12. nodo *crearNodo(int);
  13. void insertar_nodo (nodo *&, int);
  14. void menu();
  15. void mostrarArbol(nodo,int);
  16. nodo *arbol = NULL;
  17. int main() {
  18.  
  19. menu();
  20.  
  21.  
  22. return 0;
  23. }
  24.  
  25. void menu(){
  26. int dato,opcion,contador = 0;
  27. do {
  28.  
  29. cout<<"Menus: "<<endl;
  30. cout<<"1. Insertar un nuevo nodo: "<<endl;
  31. cout<<"2. Mostar arbol Completo:  "<<endl;
  32. cout<<"3. Salir"<<endl;
  33. cin>>opcion;
  34. void mostarArbol(nodo*,int);
  35.  
  36. switch (opcion){
  37. case 1 : cout<<"digite Numero: ";
  38. cin >> dato;
  39. insertar_nodo (arbol , dato);
  40. cout<<"";
  41. system("PAUSE");
  42. break;
  43. case 2:   cout<<"Arbol";
  44. mostarArbol(arbol,contador);
  45. system ("PAUSE");
  46. break;
  47. }
  48. system ("cls");
  49. }while (opcion = !3);
  50. }
  51.  
  52.  
  53.  
  54.  
  55.  
  56. nodo *crearNodo(int n){
  57. nodo *nuevo_nodo = new nodo();
  58.  
  59.  
  60. }
  61.  
  62. void insertar_nodo (nodo *& arbol,int n){
  63. if (arbol == NULL){
  64.  
  65. nodo *nuevo_nodo = crearNodo(n);
  66. arbol = nuevo_nodo;
  67. }else {
  68. int valorRaiz = arbol ->dato;
  69.  
  70. if(n < valorRaiz){
  71. insertar_nodo (arbol ->iz,n);
  72. }
  73. else{
  74. insertar_nodo (arbol->der,n);
  75. }
  76. }
  77. }
  78.  
  79. void mostrarArbol(nodo *arbol,int cont){
  80. if (arbol == NULL){
  81. return;
  82. }else {
  83. mostrarArbol(arbol->der,cont+1);
  84. for(int i=0;i<cont;i++){
  85.  
  86. cout<<"  ";
  87. }
  88. cout << arbol ->dato<<endl;
  89. mostrarArbol(arbol->iz,cont+1);
  90. }
  91.  
  92. }
7  Programación / Programación C/C++ / Algoritmo de marshall en: 21 Marzo 2019, 04:56 am
he investigado y leido sobre el algoritmo pero no encuentro las manera de como implementarlo en C++, si alguien sabe su ayuda seria de mucha ayuda

8  Programación / Programación C/C++ / programacion de grafos en: 21 Marzo 2019, 04:45 am
soy un poco nuevo en programacion y deseo saber como se puede hacer el ejemplo



Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines