Skip to content

Commit 369d32b

Browse files
committed
Cosmetic changes…
1 parent 8af38df commit 369d32b

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

Source/Factories/BSTree.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
/*
1212
note: self-balancing binary search tree (BST). Elements are positioned based on their value.
13-
After insertion, model is checked for balance and automatically completed required rotations.
13+
After insertion, model is checked for balance and automatically completes required rotations.
1414
*/
1515

1616

Source/Factories/Graph.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,9 @@ public class SwiftGraph {
171171
bestPath = itemPath
172172
pathIndex = x
173173
}
174-
175174
}
176175

177176

178-
179177
//enumerate the bestPath edges
180178
for e in bestPath.destination.neighbors {
181179

@@ -188,7 +186,6 @@ public class SwiftGraph {
188186

189187
//add the new path to the frontier
190188
frontier.append(newPath)
191-
192189
}
193190

194191

Source/Structures/Node.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import Foundation
1111

1212
//generic node used for stacks, queues and hash tables
1313

14-
1514
class Node<T> {
1615

1716
var key: T?

SwiftTests/FibTest.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,9 @@ class FibTest: XCTestCase {
133133

134134

135135
/*
136-
notes: method purposely left out of the Int class extension.
137-
function included for demonstration purposes and should not be
136+
notes: function included for demonstration purposes and should not be
138137
considered as best practice.
139-
*/
138+
*/
140139

141140
func fibExponential(n: Int) -> Int {
142141

SwiftTests/SortingTest.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class SortingTest: XCTestCase, Sortable {
2323

2424
//test input types for algorithms
2525
var numberList = [8, 2, 10, 9, 7, 5]
26+
var searchList = [0,4,7,9,13,16,34]
2627
var trivialNumberList = [1]
2728
var emptyNumberList: Array<Int> = []
2829
var textList = ["Dog", "Cat", "Dinasour", "Lion", "Cheetah", "Gazelle", "Elephant", "Aardvark"]
@@ -63,16 +64,22 @@ class SortingTest: XCTestCase, Sortable {
6364
}
6465

6566

66-
func testBinaryTestNotFound() {
67+
func testBinaryNotFound() {
6768

68-
var searchList: Array<Int> = [0,4,7,9,13,16,34]
6969
let key: Int = 8
7070

7171
//test for false positive
7272
XCTAssertFalse(searchList.binarySearch(forElement: key), "binary key value \(key) found..")
7373
}
7474

7575

76+
func testBinaryFound() {
77+
78+
let key: Int = 9
79+
80+
XCTAssertTrue(searchList.binarySearch(forElement: key), "binary key value \(key) not found..")
81+
}
82+
7683

7784
//MARK: General Sorting Algorithms
7885

0 commit comments

Comments
 (0)