You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+19-15
Original file line number
Diff line number
Diff line change
@@ -43,16 +43,15 @@ The project features code-level examples for the following items:
43
43
44
44
The Book
45
45
--------------------
46
-
Now in its **3rd edition** and supporting **Swift 4.0**, the <ahref="http://shop.waynewbishop.com"target="_blank">The Swift Algorithms Book</a> features code and color illustrations that benefits students and professionals. As a collaborative open-source effort, I also welcome <ahref="https://twitter.com/waynewbishop"target="_blank">feedback</a> and contribution from others.
46
+
Now in its **4th edition** and supporting **Swift 4.2**, the <ahref="http://shop.waynewbishop.com"target="_blank">The Swift Algorithms Book</a> features code and color illustrations that benefits students and professionals. As a collaborative open-source effort, I also welcome <ahref="https://twitter.com/waynewbishop"target="_blank">feedback</a> and contribution from others.
var vitem: Vertex = graphQueue.deQueue() as Vertex!
70
67
68
+
//traverse the next queued vertex - Swift 4.0
69
+
//var vitem: Vertex! = graphQueue.deQueue()
70
+
71
+
72
+
//traverse the next queued vertex
73
+
guardvar vitem = graphQueue.deQueue() else {
74
+
break
75
+
}
71
76
72
77
//add unvisited vertices to the queue
73
78
for e in vitem.neighbors {
74
79
if e.neighbor.visited ==false {
75
-
print("adding vertex: \(e.neighbor.key!) to queue..")
80
+
print("adding vertex: \(e.neighbor.key) to queue..")
76
81
graphQueue.enQueue(e.neighbor)
77
82
}
78
83
}
79
-
80
-
//invoke with inout parameter
81
-
formula(node: &vitem)
82
84
85
+
//invoke formula
86
+
formula(&vitem)
87
+
83
88
84
89
} //end while
85
90
86
91
87
-
print("graph traversal complete..")
88
-
92
+
print("graph traversal complete..")
93
+
89
94
}
90
-
91
95
```
92
96
93
97
Getting Started
94
98
--------------------
95
99
96
-
Swift Structures has been optimized for **Swift 4.0** (e.g., Xcode 9.0) or later. The directories are organized as follows:
100
+
Swift Structures has been optimized for **Swift 4.2** (e.g., Xcode 10.0) or later. The directories are organized as follows:
97
101
+ Source - Code for all Swift data structures, algorithms and source extensions
98
102
+ Example - An empty iOS single-view application template
99
103
+ SwiftTests - Unit tests with XCTest Framework
@@ -106,7 +110,7 @@ Individuals are welcome to use the code with commercial and open-source projects
106
110
Branches
107
111
--------------------
108
112
+ master - The production branch. Clone or fork this repository for the latest copy
109
-
+ develop - The active Swift 4.0 development branch. Swift 4.0[pull requests](https://help.github.com/articles/creating-a-pull-request) should be directed to this branch
113
+
+ develop - The active Swift 4.2 development branch. Swift 4.2[pull requests](https://help.github.com/articles/creating-a-pull-request) should be directed to this branch
0 commit comments