jweinst1
7/16/2015 - 2:10 AM

A class that acts an implementation of a tree node in Swift

A class that acts an implementation of a tree node in Swift

class Nodes {
    init(data:Int, next_node:Int) {
        var data = data
        var next_node = next_node
    }
    func GetData() ->Int {
        return Nodes.data
    }
    func GetNext() ->Int {
        return Nodes.next_node
    }
    func SetNext(new_next:Int) {
        Nodes.next_node = new_next
    }
}