Created
April 23, 2019 00:09
-
-
Save kkchu791/80073ede5ef68187430e9af489c0c730 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ass TreeNode | |
attr_accessor :value, :left, :right | |
def initialize(value) | |
@value = value | |
end | |
end | |
tree = TreeNode.new(5) | |
tree.left = TreeNode.new(3) | |
tree.right = TreeNode.new(8) | |
tree.left.left = TreeNode.new(2) | |
tree.left.right = TreeNode.new(1) | |
pp tree |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment