Skip to content

Commit 3d0bb6d

Browse files
author
Thukor
committed
Finally got findPrefix() workinggit add .git add .!
1 parent 461127f commit 3d0bb6d

File tree

11 files changed

+94
-30
lines changed

11 files changed

+94
-30
lines changed

Trie/.build/debug/Trie

7.6 KB
Binary file not shown.

Trie/.build/debug/Trie.o/Trie/main.swiftdeps

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ provides-top-level:
66
provides-nominal:
77
provides-member:
88
depends-top-level:
9-
- "StringLiteralType"
10-
- "Set"
11-
- "Array"
12-
- "print"
139
- "Trie"
10+
- "U"
11+
- "Array"
1412
- "V"
13+
- "print"
14+
- "StringLiteralType"
1515
- "T"
16-
- "U"
16+
- "Set"
17+
- "UnicodeScalarType"
1718
depends-member:
19+
- ["Ps9AnyObject", "findPrefix"]
1820
- ["Ps9AnyObject", "getWords"]
1921
- ["Ps9AnyObject", "init"]
2022
- ["Ps9AnyObject", "insert"]
@@ -110,6 +112,7 @@ depends-member:
110112
- ["Ps16SignedNumberType", "IntegerLiteralType"]
111113
- ["Ps10Strideable", "Distance"]
112114
- ["Ps10Strideable", "IntegerLiteralType"]
115+
- ["C4Trie4Trie", "findPrefix"]
113116
- ["C4Trie4Trie", "getWords"]
114117
- ["C4Trie4Trie", "init"]
115118
- ["C4Trie4Trie", "insert"]
@@ -199,4 +202,4 @@ depends-external:
199202
- "/home/christian/swiftv2/usr/lib/swift/shims/FoundationShims.h"
200203
- "/home/christian/swiftv2/usr/lib/swift/shims/CoreFoundationShims.h"
201204
- "/home/christian/swiftv2/usr/lib/swift/shims/module.map"
202-
interface-hash: "80fed5d587327a0a97180685d884fa09"
205+
interface-hash: "57319b836b718d38040ac7809f4446f7"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 0ddf238ad7)"
22
options: "1cfa30eacd63a1262ef0618da5cf7605"
3-
build_time: [515616404, 830067000]
3+
build_time: [515621198, 271577000]
44
inputs:
5-
"/home/christian/Desktop/swift-algorithm-club/Trie/sources/main.swift": [515616359, 0]
6-
"/home/christian/Desktop/swift-algorithm-club/Trie/sources/trie.swift": [515616400, 0]
5+
"/home/christian/Desktop/swift-algorithm-club/Trie/sources/main.swift": [515620938, 0]
6+
"/home/christian/Desktop/swift-algorithm-club/Trie/sources/trie.swift": [515621195, 0]
77
"/home/christian/Desktop/swift-algorithm-club/Trie/sources/Queue.swift": [512710161, 0]

Trie/.build/debug/Trie.o/Trie/trie.swiftdeps

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,30 @@ provides-member:
99
- ["C4Trie4Node", ""]
1010
- ["C4Trie4Trie", ""]
1111
depends-top-level:
12-
- "Int"
12+
- !private "StringLiteralType"
1313
- !private "UnicodeScalarType"
14-
- !private "Array"
15-
- "Node"
16-
- "Void"
17-
- !private "=="
18-
- "IntegerLiteralType"
19-
- !private "+="
20-
- "Trie"
21-
- "FloatLiteralType"
22-
- "Set"
23-
- !private "BooleanLiteralType"
14+
- !private "&&"
2415
- !private "-"
16+
- "String"
17+
- !private "BooleanLiteralType"
2518
- "Bool"
26-
- !private "print"
2719
- !private "-="
28-
- "String"
29-
- !private "&&"
20+
- "Trie"
21+
- "FloatLiteralType"
22+
- "Int"
23+
- !private "+"
24+
- "IntegerLiteralType"
3025
- !private "!"
26+
- !private "+="
27+
- !private "print"
28+
- !private "!=="
29+
- "Set"
30+
- "Node"
31+
- "Void"
32+
- !private "=="
3133
- !private "Queue"
32-
- !private "+"
33-
- !private "StringLiteralType"
3434
- !private ">"
35+
- !private "Array"
3536
depends-member:
3637
- !private ["Vs12AnyGenerator", "Element"]
3738
- !private ["Ps9AnyObject", "Array"]
@@ -53,6 +54,7 @@ depends-member:
5354
- !private ["Ps9AnyObject", "insert"]
5455
- !private ["Ps9AnyObject", "isAWord"]
5556
- !private ["Ps9AnyObject", "isNotWord"]
57+
- !private ["Ps9AnyObject", "isPrefix"]
5658
- !private ["Ps9AnyObject", "isRoot"]
5759
- !private ["Ps9AnyObject", "isValidWord"]
5860
- !private ["Ps9AnyObject", "isWord"]
@@ -64,6 +66,7 @@ depends-member:
6466
- !private ["Ps9AnyObject", "root"]
6567
- !private ["Ps9AnyObject", "setParent"]
6668
- !private ["Ps9AnyObject", "update"]
69+
- !private ["Ps9AnyObject", "visited"]
6770
- !private ["Ps9AnyObject", "wordCount"]
6871
- !private ["Ps9AnyObject", "wordList"]
6972
- ["Ps9AnyObject", ""]
@@ -92,6 +95,7 @@ depends-member:
9295
- !private ["Vs10ArraySlice", "Index"]
9396
- !private ["Ps22BidirectionalIndexType", "Distance"]
9497
- !private ["Ps22BidirectionalIndexType", "IntegerLiteralType"]
98+
- !private ["Ps22BidirectionalIndexType", "_DisabledRangeIndex"]
9599
- !private ["Ps21BitwiseOperationsType", "Distance"]
96100
- !private ["Ps21BitwiseOperationsType", "IntegerLiteralType"]
97101
- !private ["Sb", "_getBuiltinLogicValue"]
@@ -105,6 +109,7 @@ depends-member:
105109
- !private ["VSS13CharacterView", "_Element"]
106110
- !private ["VSS13CharacterView", "count"]
107111
- !private ["VSS13CharacterView", "deinit"]
112+
- !private ["VSS13CharacterView", "reverse"]
108113
- !private ["VSS13CharacterView", "suffix"]
109114
- !private ["Ps14CollectionType", "Element"]
110115
- !private ["Ps14CollectionType", "Generator"]
@@ -115,6 +120,7 @@ depends-member:
115120
- !private ["Ps14CollectionType", "count"]
116121
- !private ["Ps14CollectionType", "init"]
117122
- !private ["Ps14CollectionType", "removeAtIndex"]
123+
- !private ["Ps14CollectionType", "reverse"]
118124
- !private ["Ps14CollectionType", "subscript"]
119125
- !private ["Ps14CollectionType", "suffix"]
120126
- !private ["Ps10Comparable", "Distance"]
@@ -190,6 +196,8 @@ depends-member:
190196
- !private ["Ps8Hashable", "init"]
191197
- !private ["Ps8Hashable", "lowercaseString"]
192198
- !private ["VVSS13CharacterView5Index", "Distance"]
199+
- !private ["VVSS13CharacterView5Index", "_DisabledRangeIndex"]
200+
- !private ["VVSS13CharacterView5Index", "deinit"]
193201
- !private ["Ps9Indexable", "Element"]
194202
- !private ["Ps9Indexable", "Generator"]
195203
- !private ["Ps9Indexable", "Index"]
@@ -199,6 +207,7 @@ depends-member:
199207
- !private ["Ps9Indexable", "count"]
200208
- !private ["Ps9Indexable", "init"]
201209
- !private ["Ps9Indexable", "removeAtIndex"]
210+
- !private ["Ps9Indexable", "reverse"]
202211
- !private ["Ps9Indexable", "subscript"]
203212
- !private ["Ps9Indexable", "suffix"]
204213
- !private ["Vs17IndexingGenerator", "Element"]
@@ -268,11 +277,14 @@ depends-member:
268277
- ["C4Trie4Node", "printNode"]
269278
- ["C4Trie4Node", "setParent"]
270279
- ["C4Trie4Node", "update"]
280+
- !private ["C4Trie4Node", "visited"]
271281
- ["Sq", "Some"]
272282
- !private ["Sq", "deinit"]
273283
- !private ["Ps16OutputStreamType", "characters"]
274284
- !private ["Ps16OutputStreamType", "init"]
275285
- !private ["Ps16OutputStreamType", "lowercaseString"]
286+
- !private ["V4Trie5Queue", "dequeue"]
287+
- !private ["V4Trie5Queue", "enqueue"]
276288
- !private ["V4Trie5Queue", "init"]
277289
- !private ["Ps21RandomAccessIndexType", "Distance"]
278290
- !private ["Ps21RandomAccessIndexType", "IntegerLiteralType"]
@@ -285,8 +297,15 @@ depends-member:
285297
- !private ["Ps30RangeReplaceableCollectionType", "count"]
286298
- !private ["Ps30RangeReplaceableCollectionType", "init"]
287299
- !private ["Ps30RangeReplaceableCollectionType", "removeAtIndex"]
300+
- !private ["Ps30RangeReplaceableCollectionType", "reverse"]
288301
- !private ["Ps30RangeReplaceableCollectionType", "subscript"]
289302
- !private ["Ps30RangeReplaceableCollectionType", "suffix"]
303+
- !private ["Vs17ReverseCollection", "Generator"]
304+
- !private ["Vs17ReverseCollection", "Index"]
305+
- !private ["Vs17ReverseCollection", "_Element"]
306+
- !private ["Vs17ReverseCollection", "deinit"]
307+
- !private ["Vs12ReverseIndex", "Distance"]
308+
- !private ["Ps16ReverseIndexType", "Distance"]
290309
- !private ["Ps12SequenceType", "Element"]
291310
- !private ["Ps12SequenceType", "Generator"]
292311
- !private ["Ps12SequenceType", "Index"]
@@ -296,6 +315,7 @@ depends-member:
296315
- !private ["Ps12SequenceType", "count"]
297316
- !private ["Ps12SequenceType", "init"]
298317
- !private ["Ps12SequenceType", "removeAtIndex"]
318+
- !private ["Ps12SequenceType", "reverse"]
299319
- !private ["Ps12SequenceType", "subscript"]
300320
- !private ["Ps12SequenceType", "suffix"]
301321
- !private ["Vs3Set", "Generator"]
@@ -402,6 +422,7 @@ depends-member:
402422
- !private ["Ps12_Reflectable", "IntegerLiteralType"]
403423
- ["Ps12_Reflectable", "Some"]
404424
- !private ["Ps12_Reflectable", "SubSequence"]
425+
- !private ["Ps12_Reflectable", "_DisabledRangeIndex"]
405426
- !private ["Ps12_Reflectable", "_Element"]
406427
- !private ["Ps12_Reflectable", "_getBuiltinLogicValue"]
407428
- !private ["Ps12_Reflectable", "append"]
@@ -411,6 +432,9 @@ depends-member:
411432
- !private ["Ps12_Reflectable", "lowercaseString"]
412433
- !private ["Ps12_Reflectable", "removeAtIndex"]
413434
- !private ["Ps12_Reflectable", "subscript"]
435+
- !private ["Ps22_ReverseCollectionType", "Generator"]
436+
- !private ["Ps22_ReverseCollectionType", "Index"]
437+
- !private ["Ps22_ReverseCollectionType", "_Element"]
414438
- !private ["Ps18_SignedIntegerType", "Distance"]
415439
- !private ["Ps18_SignedIntegerType", "IntegerLiteralType"]
416440
depends-nominal:
@@ -458,6 +482,9 @@ depends-nominal:
458482
- !private "V4Trie5Queue"
459483
- !private "Ps21RandomAccessIndexType"
460484
- !private "Ps30RangeReplaceableCollectionType"
485+
- !private "Vs17ReverseCollection"
486+
- !private "Vs12ReverseIndex"
487+
- !private "Ps16ReverseIndexType"
461488
- !private "Ps12SequenceType"
462489
- !private "Vs3Set"
463490
- !private "Vs12SetGenerator"
@@ -485,6 +512,7 @@ depends-nominal:
485512
- !private "Vs26_OptionalNilComparisonType"
486513
- !private "Ps22_RandomAccessAmbiguity"
487514
- "Ps12_Reflectable"
515+
- !private "Ps22_ReverseCollectionType"
488516
- !private "Ps18_SignedIntegerType"
489517
depends-dynamic-lookup:
490518
depends-external:
@@ -501,4 +529,4 @@ depends-external:
501529
- "/home/christian/swiftv2/usr/lib/swift/shims/FoundationShims.h"
502530
- "/home/christian/swiftv2/usr/lib/swift/shims/CoreFoundationShims.h"
503531
- "/home/christian/swiftv2/usr/lib/swift/shims/module.map"
504-
interface-hash: "fd9fdb3a4bd3dfc789eaf1430eb72c67"
532+
interface-hash: "eefc37d55a335afd501967035d9090a5"
Binary file not shown.

Trie/.build/debug/Trie.o/build.db

0 Bytes
Binary file not shown.
936 Bytes
Binary file not shown.
12.8 KB
Binary file not shown.

Trie/.build/debug/Trie.swiftmodule

512 Bytes
Binary file not shown.

Trie/sources/main.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ T.insert("Hi")
88
T.insert("Hey")
99
T.insert("Hallo")
1010
T.insert("Henry")
11+
T.insert("YELLO")
1112
var U: Trie = Trie(wordList: Set(["Hey", "HO", "hello", "yolo"]))
1213
var V: Trie = T.merge(U)
1314
//T.printTrie()
@@ -31,4 +32,4 @@ assert(T.wordList.count == 3)*/
3132

3233
//T.printTrie()
3334
//print(T.find(""))
34-
//print(T.findPrefix("H"))
35+
print(T.findPrefix("H"))

0 commit comments

Comments
 (0)