Skip to content

Instantly share code, notes, and snippets.

@Abhishek9634
Last active March 22, 2018 17:37
Show Gist options
  • Save Abhishek9634/99241050f0c0550e5aa13ce69a40dc00 to your computer and use it in GitHub Desktop.
Save Abhishek9634/99241050f0c0550e5aa13ce69a40dc00 to your computer and use it in GitHub Desktop.
import Foundation
class TreeNode<T> {
var data: T
var leftNode: TreeNode?
var rightNode: TreeNode?
init(data: T,
leftNode: TreeNode? = nil,
rightNode: TreeNode? = nil) {
self.data = data
self.leftNode = leftNode
self.rightNode = rightNode
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment