Merge pull request #876 from superfunc/devel
Fixed typo's in tutorial 2
This commit is contained in:
commit
902a40ffcc
1 changed files with 2 additions and 2 deletions
|
|
@ -528,7 +528,7 @@ containers:
|
||||||
proc newNode*[T](data: T): PBinaryTree[T] =
|
proc newNode*[T](data: T): PBinaryTree[T] =
|
||||||
# constructor for a node
|
# constructor for a node
|
||||||
new(result)
|
new(result)
|
||||||
result.dat = data
|
result.data = data
|
||||||
|
|
||||||
proc add*[T](root: var PBinaryTree[T], n: PBinaryTree[T]) =
|
proc add*[T](root: var PBinaryTree[T], n: PBinaryTree[T]) =
|
||||||
# insert a node into the tree
|
# insert a node into the tree
|
||||||
|
|
@ -569,7 +569,7 @@ containers:
|
||||||
|
|
||||||
var
|
var
|
||||||
root: PBinaryTree[string] # instantiate a PBinaryTree with ``string``
|
root: PBinaryTree[string] # instantiate a PBinaryTree with ``string``
|
||||||
add(root, newNode("hallo")) # instantiates ``newNode`` and ``add``
|
add(root, newNode("hello")) # instantiates ``newNode`` and ``add``
|
||||||
add(root, "world") # instantiates the second ``add`` proc
|
add(root, "world") # instantiates the second ``add`` proc
|
||||||
for str in preorder(root):
|
for str in preorder(root):
|
||||||
stdout.writeln(str)
|
stdout.writeln(str)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue