Skip to content

Instantly share code, notes, and snippets.

@jweinst1
Created July 16, 2015 02:10
Show Gist options
  • Save jweinst1/2b378923630134748ae4 to your computer and use it in GitHub Desktop.
Save jweinst1/2b378923630134748ae4 to your computer and use it in GitHub Desktop.
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
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment