{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw2 - CSE 100 W.A Burkhard Programming Assignment Two Due...

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

View Full Document Right Arrow Icon
CSE 100 Programming Assignment Two W.A. Burkhard Due: midnight Friday February 17, 2012 Separate Chaining Hashing Hashing provides an excellent table implementation technique with expected access times independent of the table size. We implement a polymorphic instance of the table data type using separate chaining hashing together with the move-to-the-front heuristic to determine it’s performance experimentally. Your assignment is to create the table implementation in C++. Table Data Type Here is a portion of the Table header describing the functionality you must provide within your implemen- tation. 1: typedef struct { double successful[2] , unsuccessful[2] ; } Perform ; 2: 3: template <class DATA> 4: class Table { 5: private : 6: 7: // your data structure implementation choices here 8: 9: public : 10: explicit Table ( unsigned int size = 5 ) ; 11: void clear ( ) ; 12: bool insert ( DATA & data ) ; 13: bool remove ( DATA & data ) ; 14: bool access ( DATA & data ) const ; 15: Perform perform ( ) const ; 16: list<DATA> & getOne ( unsigned int i ) ; 17: } ; The explicit Table constructor, with the default parameter, creates an empty table for DATA objects. The explicit “modifier” avoids type conversion without explicit type casting. The default parameter assures a table of size five will be built unless another size is explicitly requested.
Background image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}