This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct GraphAM { | |
private var adjMatrix = [[Int?]]() | |
private var numberOfVertices: Int { | |
return adjMatrix.count | |
} | |
init(numberOfVertices: Int) { | |
adjMatrix = Array(repeating: Array(repeating: nil, count: numberOfVertices), count: numberOfVertices) | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Open Terminal | |
2. cd to your Xcode project | |
3. Execute the following when inside your target project: | |
find . -name "*.swift" -print0 | xargs -0 wc -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Found this lying around in my code folder from when I was | |
// first playing with Swift. Consider it public domain. | |
struct Graph<T: Hashable> { | |
let directed: Bool | |
var adj = Dictionary<T, [T]>() | |
init(directed d: Bool) { | |
directed = d | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ViewController.swift | |
// citizencrossfit | |
// | |
// Created by Mark Jackson on 17/11/2014. | |
// Copyright (c) 2014 Mark Jackson. All rights reserved. | |
// | |
import UIKit | |
import Alamofire |