Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eleev/swift-algorithms-data-structs

📒 Algorithms and Data Structures in Swift. The used approach attempts to fully utilize the Swift Standard Library and Protocol-Oriented paradigm.
https://github.com/eleev/swift-algorithms-data-structs

algorithms apple data-structures datastructures education ios learning playground playgrounds scenekit spritekit swift swift-algorithms swift-datastructures tutorial visualization xcode

Last synced: about 1 month ago
JSON representation

📒 Algorithms and Data Structures in Swift. The used approach attempts to fully utilize the Swift Standard Library and Protocol-Oriented paradigm.

Awesome Lists containing this project

README

        

# swift-algorithms-data-structs [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)

[![Language](https://img.shields.io/badge/language-Swift_5.3-orange.svg)]()
[![License](https://img.shields.io/badge/license-MIT-blue.svg)]()

**Last Update: 18/July/2021.**

![](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/cover-algo-datastruct.png)

### If you like the project, please give it a star ⭐ It will show the creator your appreciation and help others to discover the repo.

# ✍️ About
The repository contains examples of common `Algorithms` and `Data Structures` implemented using the latest stable version of `Swift`programming language. The development attempts to fully utilize `Standard Library` and `Protocol-Oriented` paradigm. The project provides interactive visualizations using `SpriteKit` and `SceneKit` frameworks (in development).

## 📚 Content
Each major section will be wrapped into a separete `.playground` file, meaning that `data structures` and `algorithms` will be separeted for convenient management. :octocat:

- [About](#about)
- [Data Structures](https://github.com/jVirus/swift-algorithms-data-structs/tree/master/Data%20Structures.playground/Pages)
- [Stack](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/Stack.xcplaygroundpage/Contents.swift)
- [Circular Buffer](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/CircularBuffer.xcplaygroundpage/Contents.swift)
- [Queue](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/Queue.xcplaygroundpage/Contents.swift)
- [Priority Queue](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Sources/PriorityQueue.swift)
- [Dequeue](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/Dequeue.xcplaygroundpage/Contents.swift)
- [Linked List](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/Linked%20List.xcplaygroundpage/Contents.swift)
- [Doubly Linked List](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/DoublyLinkedList.xcplaygroundpage/Contents.swift)
- Circular Linked List
- [Tree](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/Tree.xcplaygroundpage/Contents.swift)
- [Binary Tree](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/BinaryTree.xcplaygroundpage/Contents.swift)
- [Binary Search Tree](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/BinarySearchTree.xcplaygroundpage/Contents.swift)
- B-Tree
- Splay Tree
- [Red-Black Tree](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/Red-Black%20Tree.xcplaygroundpage/Contents.swift)
- AVL Tree
- Trie Tree
- Radix Tree
- Quad Tree
- Octree
- [Heap](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/Heap.xcplaygroundpage/Contents.swift)
- [Graph](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/Graph.xcplaygroundpage/Contents.swift)
- Algorithms
- [Sort](https://github.com/jVirus/swift-algorithms-data-structs/tree/master/Sort.playground/Pages)
- [Insertion](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Sort.playground/Pages/Insertion.xcplaygroundpage/Contents.swift)
- [Merge](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Sort.playground/Pages/Merge.xcplaygroundpage/Contents.swift)
- [Quick (Hoare's Partitioning Scheme)](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Sort.playground/Pages/Quick-Hoare-Scheme.xcplaygroundpage/Contents.swift)
- [Quick (Lomuto's Partitioning Scheme)](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Sort.playground/Pages/Quick-Lomuto-Scheme.xcplaygroundpage/Contents.swift)
- [Bubble](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Sort.playground/Pages/Bubble.xcplaygroundpage/Contents.swift)
- [Heap](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Sources/Heap.swift)
- [Shell](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Sort.playground/Pages/Shell.xcplaygroundpage/Contents.swift)
- [Radix](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Sort.playground/Pages/Radix.xcplaygroundpage/Contents.swift)
- [Search](https://github.com/jVirus/swift-algorithms-data-structs/tree/master/Search.playground/Pages)
- [Binary](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Search.playground/Pages/Binary.xcplaygroundpage/Contents.swift)
- [Linear](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Search.playground/Pages/Linear.xcplaygroundpage/Contents.swift)
- [Heap](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/Heap.xcplaygroundpage/Contents.swift)
- [Tree](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/Data%20Structures.playground/Pages/Tree.xcplaygroundpage/Contents.swift)
- [String Search](https://github.com/jVirus/swift-algorithms-data-structs/tree/master/String%20Search.playground)
- [Brute-Force](https://github.com/jVirus/swift-algorithms-data-structs/blob/master/String%20Search.playground/Contents.swift)
- Boyer-Moore
- Rabin-Karp
- Finite automation
- Knuth-Morris-Pratt
- Graphs
- Dijkstra's shortest path algorithm
- Minimum Spanning Tree (unweighted tree)
- Minimum Spanning Tree
- Breadth-First Search (BFS)
- Depth-First Search (DFS)
- Shortest Path (unweighted tree)

# 📺 Interactive Visualizations
The following list contains interactive visualizations that were implemented as part of the project. In majority of cases you can interact with a `data structure` or `algorithm` through a number of `UI` controlls. Visualizations are implemented using `SpriteKit` framework and are intended to explain the work of `data structures` and `algorithms` in a more highlevel way, which is a great way to learn especially if you are a beginner or you aren't familiar with something listed in the repository.

## Stack
Stack visalization has two main UI controlls: `push` and `pop`. They perform corresponding operations: adding a new book at the top of the stack and removing the top book from the stack. Also there is a label that shows how many books are in the stack. Since the screen size is limited and for the sake of simplicity, the number of books in stack is limited.

## Queue
Queue visualization is similar to Stack interactive visualization: it has two main `UI` controls that allow you to interact with the interface of the `Queue` data structure for `enqueue` and `dequeue` operations. You can see the number of animals in the queue as well.

# 👨‍💻 Author
[Astemir Eleev](https://github.com/jVirus)

# 🔖 Licence
THE PROJECT IS UNDER [MIT](https://github.com/jVirus/iOS-Algo-Play-Book/blob/master/LICENSE) LICENCE