SHARE
TWEET

Untitled

a guest Oct 10th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def load_dictionary(hash_table,filename,time_limit):
  2.     file = open(filename, 'r')
  3.     f = file.readlines()
  4.  
  5.     start1 = timeit.default_timer()
  6.  
  7.     for line in f:
  8.         hash_table.__setitem__(line,1)
  9.  
  10.     stop1 = (timeit.default_timer() - start1)
  11.  
  12.     file.close()
  13.  
  14.     if start1-stop1 > time_limit:
  15.         raise IndexError
  16.     return stop1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top