feat: Add Ruby code - chapter "Hashing" (#1276)

* feat: add ruby code - chapter hashing

* feat: add ruby code blocks - chapter hashing

* fix: comments
This commit is contained in:
khoaxuantu
2024-04-15 15:20:26 +07:00
committed by GitHub
parent 2b11639103
commit be9931c8a1
9 changed files with 618 additions and 30 deletions
+5
View File
@@ -56,3 +56,8 @@ def print_tree(root, prev=nil, is_right=false)
trunk.str = " |"
print_tree(root.left, trunk, false)
end
### 打印哈希表 ###
def print_hash_map(hmap)
hmap.entries.each { |key, value| puts "#{key} -> #{value}" }
end