About: dbkwik:resource/WX9X8eoTWXHiOYBKjpMQFQ==   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

AttributesValues
rdfs:label
  • Hashing-Beispiel
rdfs:comment
  • habs nur mal abgetippt. noch nicht auf funktion getestet. #include #include #include #define HASHSIZE 11 #define NULL 0 struct NODE { int key; char name[31]; NODE* pNext; }; void Einfuegen(NODE* pNeu); NODE* Suchen(int key); int Loeschen(int key); NODE* hashtable[HASHSIZE]={0}; //Vorne Einfügen void Einfuegen(NODE* pNeu) { int hashval = pNeu->key % HASHSIZE; pNeu->pNext=hashtable[hashval]; hashtable[hashval]=pNeu; } NODE* Suchen(int key) { int hashval = key % HASHSIZE; NODE* pWork = hashtable[hashval]; while(pWork!=NULL) { if(pWork->key == key) { return pWork; } pWork=pWork->pNext; } return NULL; } int Loeschen(int key) { int hashval = key % HASHSIZE; NODE* pNode = hashtable[hashval]; NODE* pPrev = NULL; while(pNode != NULL) { if(pNode->key == key) { if(pPrev == NULL) { hashtable[hashva
dcterms:subject
abstract
  • habs nur mal abgetippt. noch nicht auf funktion getestet. #include #include #include #define HASHSIZE 11 #define NULL 0 struct NODE { int key; char name[31]; NODE* pNext; }; void Einfuegen(NODE* pNeu); NODE* Suchen(int key); int Loeschen(int key); NODE* hashtable[HASHSIZE]={0}; //Vorne Einfügen void Einfuegen(NODE* pNeu) { int hashval = pNeu->key % HASHSIZE; pNeu->pNext=hashtable[hashval]; hashtable[hashval]=pNeu; } NODE* Suchen(int key) { int hashval = key % HASHSIZE; NODE* pWork = hashtable[hashval]; while(pWork!=NULL) { if(pWork->key == key) { return pWork; } pWork=pWork->pNext; } return NULL; } int Loeschen(int key) { int hashval = key % HASHSIZE; NODE* pNode = hashtable[hashval]; NODE* pPrev = NULL; while(pNode != NULL) { if(pNode->key == key) { if(pPrev == NULL) { hashtable[hashval] = pNode->pNext; } else { pPrev->pNext = pNode->pNext; } free(pNode); return 1; } pPrev = pNode; pNode = pNode->pNext; } return 0; }
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software