I want to have a simple code that demonstrtes hasch table and its concept.
1
Expert's answer
2015-09-01T00:49:41-0400
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections; /*
Hashtable class is designed to create a collection in which to store its elements is a hash table. * Information is stored in a hash table by using a mechanism called hashing. * When hashing to determine the unique value called a hash code, using the information content of a special key. * Summarized hash code serves as an index into a table in which desired data stored corresponding to the specified key. * Converting a key in the hash code is executed automatically, * and therefore it is the hash code is not available to the user at all. The advantage of hashing is that it provides a constant-time search operations, retrieving and setting values irrespective of the magnitude data arrays.
*/ namespace HashExample { class Program { static void Main(string[] args) { // Create a hash table Hashtable htexample = new Hashtable();
// Добавим несколько записей htexample.Add("BillGates5", "123bg"); htexample.Add("ElonMAsk", "345em"); htexample.Add("SteveJobs", "678SJ");
// We consider the collection of keys ICollection keys = htexample.Keys;
foreach (string s in keys) Console.WriteLine(s + ": " + htexample[s]);
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment