Posteado por: softmetal en: Octubre 25, 2008
Que es Hash table, Basicamente es una estructura de datos con 2 elementos, un identificador y el dato asociado a este dato. Es decir cada elemento dentro de un Hast table cuenta con un identificador y un valor, para ser mas claros, veamos que dice Wikipedia al respecto:
“In computer science, a hash table, or a hash map, is a data structure that associates keys with values. The primary operation it supports efficiently is a lookup: given a key (e.g. a person’s name), find the corresponding value (e.g. that person’s telephone number). It works by transforming the key using a hash function into a hash, a number that is used as an index in an array to locate the desired location (“bucket”) where the values should be.”
Bueno, cabe mensionar que este es un termino general, y no exclusivo de Visual Studio, tambien es implementado en Java, Action Script, Java Script, etc.
Hablando de Visual Studio, El .Net Framework cuenta con una clase no generica llamada hashtable, que nos permite implementar este tipo de estructura y varias propiedades tipicas de esta, de forma muy facil, aqui un ejemplo:
Using System.Collections;
Hashtable familia = new Hashtable();
familia.Add(“Padre”, “Fulanito de tal”);
familia.Add(“Madre”, “Perenganita de tal”);
familia.Add(“Hijo”, “Chavito de tal”);
System.Console.WriteLine(“El papa se llama: {0}, la mama se llama: {1} y tienen un hijo llamado:{2}”, familia["Padre"], familia["Madre"], familia["Hijo"]);
System.Console.ReadLine();
Eso es todo como se podran dar cuenta, es muy facil su funcionamiento, espero les sirva, Excelente funcion.
OLA SOY PROGRAMADOR ESTOY APRENDIENDO C# CON ASP.NET ME GUSTARIA SABER SI ME PODRIAS PASAR MATERIAL ACERCA DE ESTO. TE LO AGRADACERIA VASTANTE
Abril 23, 2009 a 7:41 pm
alguien sabe de mas tips del 2008??