Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sub_decodeTree(dataIN,iL):
- res = None
- if iL[0] < len(dataIN):
- res = binTree.BinTree(None,None,None)
- if dataIN[iL[0]] == '0':
- iL = [iL[0]+1]
- res.left = sub_decodeTree(dataIN,iL)
- iL = [iL[0]+9]
- res.right = sub_decodeTree(dataIN,iL)
- else:
- word = ''
- for i in range(8):
- word += dataIN[iL[0]+i+1]
- word = toBinary(word)[0]
- res.key = word
- return res
- swag = sub_decodeTree('0010111010010110001001011000010101100011101100101',[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement