File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ public class Node {
191
191
func printNode( var indent: String , leaf: Bool ) {
192
192
193
193
print ( indent, terminator: " " )
194
- if ( leaf) {
194
+ if leaf {
195
195
print ( " \\ - " , terminator: " " )
196
196
indent += " "
197
197
}
@@ -359,7 +359,7 @@ public class Trie {
359
359
length -= 1
360
360
index += 1
361
361
362
- if ( length == 0 ) {
362
+ if length == 0 {
363
363
currentNode. isWord ( )
364
364
wordList. append ( w)
365
365
wordCount += 1
@@ -407,7 +407,7 @@ public class Trie {
407
407
func remove( w: String ) -> ( word: String , removed: Bool ) {
408
408
let word = w. lowercaseString
409
409
410
- if ( !self . contains ( w) ) {
410
+ if !self . contains ( w) {
411
411
return ( w, false )
412
412
}
413
413
var currentNode = self . root
@@ -464,10 +464,10 @@ public class Trie {
464
464
465
465
while let current = q. dequeue ( ) {
466
466
for (char, child) in current. getChildren ( ) {
467
- if ( !child. visited) {
467
+ if !child. visited {
468
468
q. enqueue ( child)
469
469
child. visited = true
470
- if ( child. isValidWord ( ) ) {
470
+ if child. isValidWord ( ) {
471
471
var currentNode = child
472
472
while currentNode !== n {
473
473
tmp += currentNode. char ( )
You can’t perform that action at this time.
0 commit comments