Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. void QuadraticHashTable<HashedObj>::insert( const HashedObj & x )
  2. {
  3. // Insert x as active
  4. int currentPos = findPos( x.portNum );
  5. if( isActive( currentPos ) )
  6. return;
  7. array[ currentPos ] = HashEntry( x.portNum, ACTIVE );
  8.  
  9. // Rehash; see Section 5.5
  10. if( ++currentSize > array.size( ) / 2 )
  11. rehash( );
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement