Cerrado

C++ Hash Table Implementation

I need a working C++ Implementaion of a Hash Table that is based on the code that can be freely downloaded from <[url removed, login to view]>.

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.

[url removed, login to view] = 14;

strcpy( [url removed, login to view], "Rick" );

[url removed, login to view] = 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 = [url removed, login to view]( Key, 3, &md, sizeof( MYDATA ) );

// Assign values to the md structure.

[url removed, login to view] = 24;

strcpy( [url removed, login to view], "Sam" );

[url removed, login to view] = 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 = [url removed, login to view]( Key, 4, &md, sizeof( MYDATA ) );

// Now get a value out.

MYDATA *md2 = [url removed, login to view]( Key, 4 );

// This could also be

// MYDATA *md2 = [url removed, login to view]( nUniqueID2 );

if( md2 != NULL )

{

printf( "%s\n", md2->Name );

}

Habilidades: Arquitectura de software

Ver más: hash table implementation, hashtable implementation, mfc hash table, hash table assign key, hash table, hash table project, what is stl, what is stack data structure, what is data structures, what is data entry speed, what is data entry 10 key, what is an unsigned integer, what is a data structures, what is a 10 key data entry, using stl, use of data structures, used structures, unsigned integer, tech demo 2011, table data structure, stl standard, stl stack, stl size, stl sample, stl hash

Información del empleador:
( 149 comentarios ) Orlando, United States

ID de proyecto: #3035360

11 los freelancers están ofertando un promedio de $91 para este trabajo.

Schura

See private message.

$85 USD en 3 días
(56 comentarios)
5.4
LGLSoftware

See private message.

$102 USD en 3 días
(84 comentarios)
5.3
vw7892265vw

See private message.

$85 USD en 3 días
(10 comentarios)
3.9
studiovsolution

See private message.

$106.25 USD en 3 días
(21 comentarios)
3.5
zeroboo

See private message.

$85 USD en 3 días
(7 comentarios)
3.9
hsanshu

See private message.

$102 USD en 3 días
(8 comentarios)
2.8
ahmedabozead

See private message.

$85 USD en 3 días
(3 comentarios)
2.8
kernelinside

See private message.

$85 USD en 3 días
(0 comentarios)
0.0
tutonslg

See private message.

$85 USD en 3 días
(0 comentarios)
0.0
alanw123vw

See private message.

$85 USD en 3 días
(0 comentarios)
0.0
coderabhishek

See private message.

$85 USD en 3 días
(1 comentario)
1.3
TRUSTY786

See private message.

$97.75 USD en 3 días
(3 comentarios)
0.0