A very simple Swift Package with implemented Data Structure and Algorithms for direct use into project.
To understand recursion one should understand recursion.
Don't forget to star the repo 😊.
- LinkedList
- Singly Linked List
- Doubly Linked List
- Queues
- Queue as Array
- Queue as LinkedList
- Stacks
- Stack as Array
- Stack as LinkedList
- Linear Search
- Binary Search
- Bubble Sort
- Insertion Sort
- Via Swift Packages
- Search for
AlgoBrain
and select the version to install
import AlgoBrain
Using a Linked list
var linkedList = LinkedList<Int>()
linkedList.insertAt(.end, with: 0)
linkedList.insertAt(.start, with: 1)
linkedList.insertAt(.start, with: 2)
linkedList.insertAt(.start, with: 3)
linkedList.insertAt(.index(2), with: 4)
print(linkedList.head) // 3 -> 2 -> 4 -> 1 -> 0
linkedList.removeAt(.start)
linkedList.removeAt(.end)
linkedList.removeAt(.index(2))
print(linkedList.head) // 2 -> 4
Similarly other datastructures and algorithms can be used.
Note: All the methods from libray are marked with their Time Complexity.
- Tree
- Hashing
- Graph
- .......
- Insertion Sort
- Selection Sort
- Quick Sort
- Merge Sort
- Heap Sort
- Radix Sort
- Counting Sort
- Shell Sort