Skip to content

Commit a56b883

Browse files
committed
[Swift 4.2] Update Binary Search Tree
1 parent f08d5fc commit a56b883

File tree

9 files changed

+64
-78
lines changed

9 files changed

+64
-78
lines changed

Binary Search Tree/Solution 1/BinarySearchTree.playground/Contents.swift

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
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-
83
let tree = BinarySearchTree<Int>(value: 7)
94
tree.insert(value: 2)
105
tree.insert(value: 5)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Binary Search Tree/Solution 1/Tests/Tests.xcodeproj/project.pbxproj

+39-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 51;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -83,17 +83,17 @@
8383
isa = PBXProject;
8484
attributes = {
8585
LastSwiftUpdateCheck = 0720;
86-
LastUpgradeCheck = 0720;
86+
LastUpgradeCheck = 1000;
8787
ORGANIZATIONNAME = "Swift Algorithm Club";
8888
TargetAttributes = {
8989
7B2BBC7F1C779D720067B71D = {
9090
CreatedOnToolsVersion = 7.2;
91-
LastSwiftMigration = 0820;
91+
LastSwiftMigration = 1000;
9292
};
9393
};
9494
};
9595
buildConfigurationList = 7B2BBC6C1C779D710067B71D /* Build configuration list for PBXProject "Tests" */;
96-
compatibilityVersion = "Xcode 3.2";
96+
compatibilityVersion = "Xcode 10.0";
9797
developmentRegion = English;
9898
hasScannedForEncodings = 0;
9999
knownRegions = (
@@ -141,13 +141,23 @@
141141
CLANG_CXX_LIBRARY = "libc++";
142142
CLANG_ENABLE_MODULES = YES;
143143
CLANG_ENABLE_OBJC_ARC = YES;
144+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
144145
CLANG_WARN_BOOL_CONVERSION = YES;
146+
CLANG_WARN_COMMA = YES;
145147
CLANG_WARN_CONSTANT_CONVERSION = YES;
148+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
146149
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
147150
CLANG_WARN_EMPTY_BODY = YES;
148151
CLANG_WARN_ENUM_CONVERSION = YES;
152+
CLANG_WARN_INFINITE_RECURSION = YES;
149153
CLANG_WARN_INT_CONVERSION = YES;
154+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
155+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
156+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
150157
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
158+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
159+
CLANG_WARN_STRICT_PROTOTYPES = YES;
160+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
151161
CLANG_WARN_UNREACHABLE_CODE = YES;
152162
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
153163
CODE_SIGN_IDENTITY = "-";
@@ -185,13 +195,23 @@
185195
CLANG_CXX_LIBRARY = "libc++";
186196
CLANG_ENABLE_MODULES = YES;
187197
CLANG_ENABLE_OBJC_ARC = YES;
198+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
188199
CLANG_WARN_BOOL_CONVERSION = YES;
200+
CLANG_WARN_COMMA = YES;
189201
CLANG_WARN_CONSTANT_CONVERSION = YES;
202+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
190203
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
191204
CLANG_WARN_EMPTY_BODY = YES;
192205
CLANG_WARN_ENUM_CONVERSION = YES;
206+
CLANG_WARN_INFINITE_RECURSION = YES;
193207
CLANG_WARN_INT_CONVERSION = YES;
208+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
209+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
210+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
194211
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
212+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
213+
CLANG_WARN_STRICT_PROTOTYPES = YES;
214+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
195215
CLANG_WARN_UNREACHABLE_CODE = YES;
196216
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
197217
CODE_SIGN_IDENTITY = "-";
@@ -210,6 +230,7 @@
210230
MACOSX_DEPLOYMENT_TARGET = 10.11;
211231
MTL_ENABLE_DEBUG_INFO = NO;
212232
SDKROOT = macosx;
233+
SWIFT_COMPILATION_MODE = wholemodule;
213234
};
214235
name = Release;
215236
};
@@ -218,10 +239,15 @@
218239
buildSettings = {
219240
COMBINE_HIDPI_IMAGES = YES;
220241
INFOPLIST_FILE = Info.plist;
221-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
242+
LD_RUNPATH_SEARCH_PATHS = (
243+
"$(inherited)",
244+
"@executable_path/../Frameworks",
245+
"@loader_path/../Frameworks",
246+
);
222247
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.Tests;
223248
PRODUCT_NAME = "$(TARGET_NAME)";
224-
SWIFT_VERSION = 3.0;
249+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
250+
SWIFT_VERSION = 4.2;
225251
};
226252
name = Debug;
227253
};
@@ -230,10 +256,15 @@
230256
buildSettings = {
231257
COMBINE_HIDPI_IMAGES = YES;
232258
INFOPLIST_FILE = Info.plist;
233-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
259+
LD_RUNPATH_SEARCH_PATHS = (
260+
"$(inherited)",
261+
"@executable_path/../Frameworks",
262+
"@loader_path/../Frameworks",
263+
);
234264
PRODUCT_BUNDLE_IDENTIFIER = swift.algorithm.club.Tests;
235265
PRODUCT_NAME = "$(TARGET_NAME)";
236-
SWIFT_VERSION = 3.0;
266+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
267+
SWIFT_VERSION = 4.2;
237268
};
238269
name = Release;
239270
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Binary Search Tree/Solution 1/Tests/Tests.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0720"
3+
LastUpgradeVersion = "1000"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Binary Search Tree/Solution 2/BinarySearchTree.playground/Contents.swift

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
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-
83
// Each time you insert something, you get back a completely new tree.
94
var tree = BinarySearchTree.leaf(7)
105
tree = tree.insert(newValue: 2)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Binary Search/BinarySearch.playground/Sources/BinarySearch.swift

-52
This file was deleted.

Binary Search/BinarySearch.playground/playground.xcworkspace/contents.xcworkspacedata

-7
This file was deleted.

0 commit comments

Comments
 (0)