Skip to content

Commit c34a96d

Browse files
author
Shashwat Kathuria
committedApr 2, 2019
Modified print statements to take less space in output.txt
1 parent 3dcc744 commit c34a96d

File tree

1 file changed

+2
-3
lines changed
  • Hash Table Implementation - 2 Sum Algorithm

1 file changed

+2
-3
lines changed
 

‎Hash Table Implementation - 2 Sum Algorithm/2SUM.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ def main():
1717
file = open("2SUM.txt", "r")
1818

1919
listOfElements = []
20+
print("READING ELEMENTS FROM THE FILE..PLEASE WAIT ")
2021
for i in range(1000000):
2122
element = int( file.readline() )
2223
listOfElements.append( [element, hashFunction(element)] )
23-
print("READING ELEMENT NUMBER " + str(i + 1))
2424

2525
# Separate chaining the hash table using a quick and dirty hash function
26+
print("INSERTING ELEMENTS INTO THE HASH TABLE..PLEASE WAIT ")
2627
for i in range(1000000):
27-
print("INSERTING ELEMENT NUMBER " + str(i + 1))
28-
2928
temp = []
3029
temp = ( hashTable[listOfElements[i][1]] ) [ : ]
3130

0 commit comments

Comments
 (0)
Please sign in to comment.