Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Tabla de Dispersion
Tabla de Dispersion
ESTADO DE HIDALGO
ING. EN SISTEMAS COMPUTACIONALES
ESTRUCTURA DE DATOS
3-A
Tabla de Dispersin
Clase mData
- int[] datos;
+ mData(int position, string
datum):int
+setPosition(int)
+getPosition():int
+setDatum(int)
+getDatum():int
Cdigo
de la clase mData
class mData
{
public mData(int position, string datum)
{
Position = position;
Datum = datum;
}
public mData(int position)
{
Position = position;
}
private int position;
public int Position
{
get { return position; }
set { position = value; }
}
private string datum;
public string Datum
{
get { return datum; }
set { datum = value; }
}
}
cd Class Model
Nodo
Form1
Nodo()
Nodo(int)
setDato(int)
getDato() : int
setIzq(Nodo)
getIzq() : Nodo
setDer(Nodo)
getDer() : Nodo
+
+
+
+
+
+
+
+
dato: int
izq: Nodo
der: Nodo
class Nodo
{
private string dato;
private
private
private
private
int posicion;
Nodo[] nodos;
string[] arregloDatos;
int codigo;
public Form1()
{
InitializeComponent();
nodos = new Nodo[11];
arregloDatos = new string[50];
posicion = -1;
codigo = 0;
agregarPalabras();
mostrar();
}
private void agregarPalabras() //inserccion de datos
{
arregloDatos[0] = "Juan";
arregloDatos[1] = "Carlos";
arregloDatos[2] = "Orlando";
arregloDatos[3] = "Enrique";
arregloDatos[4] = "Mario";
arregloDatos[5] = "Maria";
arregloDatos[6] = "Pablo";
arregloDatos[7] = "Mateo";
arregloDatos[8] = "Oscar";
arregloDatos[9] = "Ana";
arregloDatos[10] = "Ricardo";
arregloDatos[11] = "Ian";
arregloDatos[12] = "Ines";
arregloDatos[13] = "Felipe";
arregloDatos[14] = "Miguel";
arregloDatos[15] = "Elefante";
arregloDatos[16] = "Aguila";
arregloDatos[17] = "Puma";
arregloDatos[18] = "Leon";
arregloDatos[19] = "Tigre";
arregloDatos[20] = "Vaca";
arregloDatos[21] = "Perro";
arregloDatos[22] = "Gato";
arregloDatos[23] = "Venado";
arregloDatos[24] = "Hipopotamo";
arregloDatos[25] = "Mono";
arregloDatos[26] = "Mariposa";
arregloDatos[27] = "Puerco";
arregloDatos[28] = "Jaguar";
arregloDatos[29] = "Armenia";
arregloDatos[30] = "Australia";
arregloDatos[31] = "Belgica";
arregloDatos[32] = "Afganistan";
arregloDatos[33] = "Alemania";
arregloDatos[34] = "Mexico";
arregloDatos[35] = "Portugal";
arregloDatos[36] = "Micronesia";
arregloDatos[37] = "Nigeria";
arregloDatos[38] = "Noruega";
arregloDatos[39] = "Pakistan";
arregloDatos[40] = "Qatar";
arregloDatos[41] = "Peru";
arregloDatos[42] = "Paraguay";
arregloDatos[43] = "Polonia";
arregloDatos[44] = "Rusia";
arregloDatos[45] = "Samoa";
arregloDatos[46]
arregloDatos[47]
arregloDatos[48]
arregloDatos[49]
=
=
=
=
"Siria";
"Singapur";
"Yemen";
"Venezuela"; // ultimo
}
else
{
n = n.Der;
}
}
return r;
Ejecucin