Find Jobs
Hire Freelancers

C++ Hash Table Implementation

$100-125 USD

Lezárt
Kiadva ekkor: több mint 13 évvel ezelőtt

$100-125 USD

Teljesítéskor fizetve
I need a working C++ Implementaion of a Hash Table that is based on the code that can be freely downloaded from <[login to view URL]>. The name of the class is CHashTable. It should have all standard methods necessary to use a hash table. It will be used to store data structures of a specified length (specified at runtime and not ahead of time) with a key value that is an unsigned char array of any length. Performance is critical. Speed is preferred over memory, but it would be nice if there was a switch to change the preference at runtime. Deliverable: 1. C++ MFC dialog-based Visual Studio 2008 Project that compiles correctly. 2. Do not select Unicode for the project. 3. Select MFC as static linked library for the project. 4. CHashTable class as part of the project that includes the specified methods. 5. CHashTable class is based on the SGI source code specified above. 6. Runtime switch to change between high performance/speed and small memory. 7. Simple demo usage of the class. ## Deliverables Methods: // Please note that the structure needs to be allocated since what is passed // might be coming from stack or temporary space. Returns a unique identifier // for the new hash table object. int Add( unsigned char *Key, int nKeyLength, void *structure, int nStructureSize ); // Clear all entries. bool Clear( void ); // Returns -1 (not found) or a unique integer identier from the hashtable. The // identifier is similar to the identity key that a database assigns int Contains( unsigned char *Key, int nKeyLength ); // Get pointer to null-terminated ASCII representation of the hash code. char *GetHashCode( int nIdentifier ); char *GetHashCode( unsigned char *Key, int nKeyLength ); // Return a pointer to the stored data. This will usually be a structure. Caller // should know the size of the structure, so we do not need to deal // with it here. Returns NULL if not found. void *GetObjectData( unsigned char *Key, int nKeyLength ); // Remove a single entry. bool Remove( unsigned char *Key, int nKeyLength ); bool Remove( int nIdentifier ); Performance is critical. Speed is preferred over memory, but it would be nice if there was a switch to change the preference at runtime. Deliverable: 1. C++ MFC dialog-based Visual Studio 2008 Project that compiles correctly. 2. Do not select Unicode for the project. 3. Select MFC as static linked library for the project. 4. CHashTable class as part of the project that includes the specified methods. 5. CHashTable class is based on the SGI source code specified above. 6. Runtime switch to change between high performance/speed and small memory. 7. Simple demo usage of the class. Sample usage: // The struct I am using. // This can be any struct, though, // when calling the Add method. typedef struct { int nValue; char Name[100]; double dAge; } MYDATA; // Declare stuff. CHashTable ht; MYDATA md; unsigned char Key[10]; // Assign values to the md structure. [login to view URL] = 14; strcpy( [login to view URL], "Rick" ); [login to view URL] = 14.14; // Build the key. Please note that it is // not null terminated Key[0] = 14; Key[1] = 15; Key[2] = 'C'; // Call the Add method and get the unique ID for the // newly-created object. int nUniqueID = [login to view URL]( Key, 3, &md, sizeof( MYDATA ) ); // Assign values to the md structure. [login to view URL] = 24; strcpy( [login to view URL], "Sam" ); [login to view URL] = 24.24; // Build the key. Please note that it is // not null terminated Key[0] = 24; Key[1] = 25; Key[2] = 'D'; Key[3] = 'Z'; // Call the Add method and get the unique ID for the // newly-created object. int nUniqueID2 = [login to view URL]( Key, 4, &md, sizeof( MYDATA ) ); // Now get a value out. MYDATA *md2 = [login to view URL]( Key, 4 ); // This could also be // MYDATA *md2 = [login to view URL]( nUniqueID2 ); if( md2 != NULL ) { printf( "%s\n", md2->Name ); }
Projektazonosító: 3035360

A projektről

11 ajánlat
Távolról teljesíthető projekt
Aktiválva: 13 évvel ezelőtt

Szeretne pénzt keresni?

A Freelancer oldalán történő árajánlatadás előnyei

Határozzon meg költségvetést és időkeretet
Kapja meg fizetését a munkáért
Vázolja ajánlatát
Ingyen regisztrálhat és adhat árajánlatot munkákra
11 szabadúszó adott átlagosan $91 USD összegű árajánlatot erre a munkára
Felhasználó avatár
See private message.
$85 USD 3 napon belül
4,7 (56 értékelés)
5,4
5,4
Felhasználó avatár
See private message.
$102 USD 3 napon belül
4,9 (84 értékelés)
5,3
5,3
Felhasználó avatár
See private message.
$85 USD 3 napon belül
5,0 (10 értékelés)
3,9
3,9
Felhasználó avatár
See private message.
$106,25 USD 3 napon belül
5,0 (21 értékelés)
3,5
3,5
Felhasználó avatár
See private message.
$85 USD 3 napon belül
2,2 (7 értékelés)
3,9
3,9
Felhasználó avatár
See private message.
$102 USD 3 napon belül
5,0 (8 értékelés)
2,8
2,8
Felhasználó avatár
See private message.
$85 USD 3 napon belül
5,0 (3 értékelés)
2,8
2,8
Felhasználó avatár
See private message.
$85 USD 3 napon belül
0,0 (0 értékelés)
0,0
0,0
Felhasználó avatár
See private message.
$85 USD 3 napon belül
0,0 (0 értékelés)
0,0
0,0
Felhasználó avatár
See private message.
$85 USD 3 napon belül
0,0 (0 értékelés)
0,0
0,0
Felhasználó avatár
See private message.
$85 USD 3 napon belül
0,0 (1 értékelés)
1,3
1,3
Felhasználó avatár
See private message.
$97,75 USD 3 napon belül
0,0 (3 értékelés)
0,0
0,0

Az ügyfélről

UNITED STATES zászlója
Orlando, United States
5,0
149
Fizetési mód hitelesítve
Tagság kezdete: ápr. 23, 2002

Ügyfél-hitelesítés

Köszönjük! E-mailben elküldtük a linket, melyen átveheti ajándék egyenlegét.
E-mailje elküldése során valami hiba történt. Kérjük, próbálja újra.
Regisztrált Felhasználók Összes Közzétett Munka
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Előnézet betöltése
Hozzáférést adott a helymeghatározáshoz.
Belépési munkamenete lejárt, és kijelentkeztettük. Kérjük, lépjen be újra.