Skip to content

Commit ecef3c7

Browse files
authored
Merge pull request #542 from remlostime/shortest-path-swift
[Swift 4] Update All Pairs Shortest Paths
2 parents e4ae21d + b8d324e commit ecef3c7

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

All-Pairs Shortest Paths/APSP/APSP.playground/Contents.swift

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
//: Playground - noun: a place where people can play
22

3+
// last checked with Xcode 9.0b4
4+
#if swift(>=4.0)
5+
print("Hello, Swift 4!")
6+
#endif
7+
38
import Graph
49
import APSP
510

All-Pairs Shortest Paths/APSP/APSP.playground/timeline.xctimeline

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
version = "3.0">
44
<TimelineItems>
55
<LoggerValueHistoryTimelineItem
6-
documentLocation = "#CharacterRangeLen=0&amp;CharacterRangeLoc=888&amp;EndingColumnNumber=44&amp;EndingLineNumber=29&amp;StartingColumnNumber=3&amp;StartingLineNumber=28&amp;Timestamp=486844329.035763"
6+
documentLocation = "file:///Users/kachen/src/swift-algorithm-club/All-Pairs%20Shortest%20Paths/APSP/APSP.playground#CharacterRangeLen=0&amp;CharacterRangeLoc=971&amp;EndingColumnNumber=68&amp;EndingLineNumber=34&amp;StartingColumnNumber=68&amp;StartingLineNumber=34&amp;Timestamp=523221730.015692"
77
selectedRepresentationIndex = "0"
88
shouldTrackSuperviewWidth = "NO">
99
</LoggerValueHistoryTimelineItem>
1010
<LoggerValueHistoryTimelineItem
11-
documentLocation = "#CharacterRangeLen=4&amp;CharacterRangeLoc=825&amp;EndingColumnNumber=9&amp;EndingLineNumber=29&amp;StartingColumnNumber=5&amp;StartingLineNumber=29&amp;Timestamp=486844329.036018"
11+
documentLocation = "file:///Users/kachen/src/swift-algorithm-club/All-Pairs%20Shortest%20Paths/APSP/APSP.playground#CharacterRangeLen=4&amp;CharacterRangeLoc=908&amp;EndingColumnNumber=9&amp;EndingLineNumber=34&amp;StartingColumnNumber=5&amp;StartingLineNumber=34&amp;Timestamp=523221730.015887"
1212
selectedRepresentationIndex = "0"
1313
shouldTrackSuperviewWidth = "NO">
1414
</LoggerValueHistoryTimelineItem>

All-Pairs Shortest Paths/APSP/APSP.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@
388388
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
389389
PRODUCT_BUNDLE_IDENTIFIER = "com.swift-algorithm-club.APSPTests";
390390
PRODUCT_NAME = "$(TARGET_NAME)";
391-
SWIFT_VERSION = 3.0;
391+
SWIFT_VERSION = 4.0;
392392
};
393393
name = Debug;
394394
};
@@ -400,7 +400,7 @@
400400
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
401401
PRODUCT_BUNDLE_IDENTIFIER = "com.swift-algorithm-club.APSPTests";
402402
PRODUCT_NAME = "$(TARGET_NAME)";
403-
SWIFT_VERSION = 3.0;
403+
SWIFT_VERSION = 4.0;
404404
};
405405
name = Release;
406406
};

All-Pairs Shortest Paths/APSP/APSPTests/APSPTests.swift

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ struct TestCase<T> where T: Hashable {
2020

2121
class APSPTests: XCTestCase {
2222

23+
func testSwift4() {
24+
// last checked with Xcode 9.0b4
25+
#if swift(>=4.0)
26+
print("Hello, Swift 4!")
27+
#endif
28+
}
29+
2330
/**
2431
See Figure 25.1 of “Introduction to Algorithms” by Cormen et al, 3rd ed., pg 690
2532
*/

Graph/GraphTests/GraphTests.swift

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ import XCTest
1010

1111
class GraphTests: XCTestCase {
1212

13+
func testSwift4() {
14+
// last checked with Xcode 9.0b4
15+
#if swift(>=4.0)
16+
print("Hello, Swift 4!")
17+
#endif
18+
}
19+
1320
func testAdjacencyMatrixGraphDescription() {
1421

1522
let graph = AdjacencyMatrixGraph<String>()

0 commit comments

Comments
 (0)