Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 08d4854

Browse files
Three Hundred - Twenty-One Commit: Implement display() function
1 parent 6585fbd commit 08d4854

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎Section_11(Hash-Table)/(2)_hash-table-linear-probing.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,19 @@ def search(self, key):
4646
return False
4747
j = j + 1
4848
return True
49+
50+
# Print contents of the table
51+
def display(self):
52+
print(self.hashtable)
53+
54+
55+
H = HashTableLinearProbe()
56+
H.insert(54)
57+
H.insert(78)
58+
H.insert(64)
59+
H.insert(92)
60+
H.insert(34)
61+
H.insert(86)
62+
H.insert(28)
63+
H.display()
64+
print('Search Result: ', H.search(34))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /