Encerrado

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] = [url removed, login to view];

// 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] = [url removed, login to view];

// 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: Arquitetura de software

Ver mais: hash table implementation, hashtable implementation, mfc hash table, hash table, hash table project, using stl, use data structures, used structures, unsigned integer, tech demo 2011, table data structure, stl standard, stl stack, stl size, stl sample, stl hash, stl data structures, stl data, stl code, stl c, stl array, stl 2, standard stl, stack data structures, stack data structure

Acerca do Empregador:
( 148 comentários ) Orlando, United States

ID do Projeto: #3035360

11 freelancers estão ofertando em média $91 para este trabalho

Schura

See private message.

$85 USD in 3 dias
(56 Comentários)
5.4
LGLSoftware

See private message.

$102 USD in 3 dias
(84 Comentários)
5.3
vw7892265vw

See private message.

$85 USD in 3 dias
(10 Comentários)
3.9
studiovsolution

See private message.

$106.25 USD in 3 dias
(21 Comentários)
3.5
zeroboo

See private message.

$85 USD in 3 dias
(7 Comentários)
3.9
hsanshu

See private message.

$102 USD in 3 dias
(8 Comentários)
2.8
ahmedabozead

See private message.

$85 USD in 3 dias
(3 Comentários)
2.8
kernelinside

See private message.

$85 USD in 3 dias
(0 Comentários)
0.0
tutonslg

See private message.

$85 USD in 3 dias
(0 Comentários)
0.0
alanw123vw

See private message.

$85 USD in 3 dias
(0 Comentários)
0.0
coderabhishek

See private message.

$85 USD in 3 dias
(1 Comentário)
1.3
TRUSTY786

See private message.

$97.75 USD in 3 dias
(3 Comentários)
0.0