Welcome to my Data Structures and Algorithms (DSA) studies repository! This repository contains my implementations and studies of various data structures and algorithms using Swift, organized in Xcode Playgrounds.
This repository is a collection of my implementations and experiments with various data structures and algorithms in Swift. It is organized using Xcode Playgrounds, making it interactive and easy to test and modify.
The following data structures are implemented in this repository:
- Arrays
- Linked Lists
- Stacks
- Queues
- Trees
- Graphs
- Hash Tables
- Heaps
The following algorithms are implemented in this repository:
Sorting Algorithms
- Bubble Sort
- Insertion Sort
- Selection Sort
- Merge Sort
- Quick Sort
Searching Algorithms
- Linear Search
- Binary Search
- Graph Algorithms:
- Depth-First Search (DFS)
- Breadth-First Search (BFS)
Dynamic Programming
- Fibonacci Sequence
- Longest Common Subsequence
- Other Algorithms:
- Dijkstra's Shortest Path
- Knuth-Morris-Pratt (KMP) String Matching
Here are some example usages of the data structures and algorithms:
// Example of Binary Search
let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
if let index = binarySearch(array, target: 5) {
print("Element found at index \(index)")
} else {
print("Element not found")
}
// Example of Merge Sort
let unsortedArray = [3, 6, 1, 8, 4, 5]
let sortedArray = mergeSort(unsortedArray)
print("Sorted Array: \(sortedArray)")
Contributions are welcome! If you have any improvements, bug fixes, or new algorithms and data structures to add, feel free to open a pull request.
- Fork the repository
- Create a new branch (git checkout -b feature-branch)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin feature-branch)
- Open a Pull Request
If you have any questions or suggestions, feel free to contact me:
- Email: ramonfsk@gmail.com
- GitHub: ramonfsk
Thank you for visiting my DSA studies repository!