Find Jobs
Hire Freelancers

C++ Hash Table Implementation

$100-125 USD

Closed
Posted over 13 years ago

$100-125 USD

Paid on delivery
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 ); }
Project ID: 3035360

About the project

11 proposals
Remote project
Active 13 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
11 freelancers are bidding on average $91 USD for this job
User Avatar
See private message.
$85 USD in 3 days
4.7 (56 reviews)
5.4
5.4
User Avatar
See private message.
$102 USD in 3 days
4.9 (84 reviews)
5.3
5.3
User Avatar
See private message.
$85 USD in 3 days
5.0 (10 reviews)
3.9
3.9
User Avatar
See private message.
$106.25 USD in 3 days
5.0 (21 reviews)
3.5
3.5
User Avatar
See private message.
$85 USD in 3 days
2.2 (7 reviews)
3.9
3.9
User Avatar
See private message.
$102 USD in 3 days
5.0 (8 reviews)
2.8
2.8
User Avatar
See private message.
$85 USD in 3 days
5.0 (3 reviews)
2.8
2.8
User Avatar
See private message.
$85 USD in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$85 USD in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$85 USD in 3 days
0.0 (0 reviews)
0.0
0.0
User Avatar
See private message.
$85 USD in 3 days
0.0 (1 review)
1.3
1.3
User Avatar
See private message.
$97.75 USD in 3 days
0.0 (3 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Orlando, United States
5.0
149
Payment method verified
Member since Apr 23, 2002

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.