mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-12 20:00:58 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user