mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
clean of unnecessary checks, imports, calls (#7993)
This commit is contained in:
@ -56,7 +56,7 @@ def traverse_tree(root: Letter | TreeNode, bitstring: str) -> list[Letter]:
|
||||
Recursively traverse the Huffman Tree to set each
|
||||
Letter's bitstring dictionary, and return the list of Letters
|
||||
"""
|
||||
if type(root) is Letter:
|
||||
if isinstance(root, Letter):
|
||||
root.bitstring[root.letter] = bitstring
|
||||
return [root]
|
||||
treenode: TreeNode = root # type: ignore
|
||||
|
Reference in New Issue
Block a user