I have this protocol
protocol BinaryTreeProtocol {
associatedtype T
var info: T { get set }
var left: Self? {get set}
var right: Self? {get set}
func addItem(item: T)
}
And I can't complete its implementation.
struct BinaryTreeImplementation: BinaryTreeProtocol {
typealias T = Int
var info: Int
var left: BinaryTreeImplementation? // There is an error here.
var right: BinaryTreeImplementation? // how can I sort it?
func addItem(item: Int) {
}
}