1Q47CA46d01 - CSE 100 Programming Assignment Two W.A....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSE 100 Programming Assignment Two W.A. Burkhard Due: midnight Friday February 19, 2010 Brent Hashing with Passbits Brent hashing provides an excellent table implementation technique with expected access times independent of the table size. We implement an instance of the table data type using Brent hashing with passbits to determine experimentally it’s performance. Your assignment is to create the table implementation in C. Table Data Type Here is the Table header for your use. This describes the functionality you must provide within your implementation. Your implementation must work for a “generic” data type. The header file Table.h resides within our homework directory on ieng6. 1: typedef void * Table ; 2: typedef void * Data ; 3: 4: typedef struct { 5: double successful , unsuccessful ; 6: } Perform ; 7: 8: Table makeTable ( unsigned sizeTable , size_t sizeData , 9: unsigned (*hash)() , int (*diff)() , void * (*copy)() , void (*free)() ) ; 10: 11: void clearTable ( Table table ) ; 12: 13: void freeTable ( Table * tptr ) ; 14: 15: boolean insertTable ( Table table , Data data ) ; 16: 17: boolean accessTable ( Table table , Data data ) ; 18: 19: Perform performTable ( Table table ) ; 20: 21: unsigned testLoc ( Table table , Data data ) ; The Table data type contains five ordinary methods as well as two especially for the course. The makeTable method arguments include the size of the table, the size of the data items as well as four functions to manipulate records associated with the structure. Your Table user manual is to describe these functions. The sizeTable value designates the number of buckets in the table, sizeData designates the size (in bytes) of the variety of data objects to be stored, the hash function serves as the hash function mapping keys to unsigned values, diff determines the difference between the keys of two data objects, and finally the copy function copies one data object to another. The diff and hash functions implicitly define the notion of key for the records....
View Full Document

This note was uploaded on 01/31/2010 for the course CSE 101 taught by Professor Staff during the Fall '08 term at UCSD.

Page1 / 4

1Q47CA46d01 - CSE 100 Programming Assignment Two W.A....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online