Skip to content

matthewfaller/algorithm-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithms & Data Structures

Build Status

docs

Programming practice implemented in Swift

Running The Project

git clone https://github.com/matthewfaller/algorithm-practice
cd algorithm-practice/
swift test

Linked List

A simple implementation of a classic structure

let list = LinkedList<String>()
list.append("Hello")
list.append("World!")

Conforms to the Sequence Protocol

let numbers: LinkedList = [1, 2, 3, 4]

let factorial = numbers.reduce(1, *)

print(factorial)

24

Uses generics

struct User: Codable, Hashable {
    let id: String
    let name: String
}

let users: LinkedList = [
    User(id: "1", name: "Emily Blunt"), 
    User(id: "2", name: "John Krasinski") 
]

users.filter(isActor).forEach(updateUser)

About

A series of practice algorithms implemented in Swift.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages