/datastructures-swift

This is a general-purpose swift repository for iOS developers, feel free to contribute.

Primary LanguageSwiftMIT LicenseMIT

datastructures-swift

BigO notation

Swift implementation for common Data Strucutures

  • HashTable
  • Array
  • Stack (Using Array | Using LinkedList)
  • Queue (Using Array | Using LinkedList)
  • LinkedList
  • DoublyLinkedList
  • Tree
  • BST(Binary Search Tree)
  • Graph (Undirected and Directed Graph) Adjacency list implementation

Swift implementation for common Algorithms

  • Recursion

  • Search

    • Linear Search
    • Binary Search
    • BFS (Breadth-first search)
    • DFS (Pre-order | In-order | Post-order) Implemented in BST
  • Sort

    • Bubble Sort
    • Selection Sort
    • Insertion Sort
    • Merge Sort
    • Quick Sort
  • Common interview coding questions:

    • Check Common Items In Array
    • Check Sum Of Items In Array
    • String Reversal
    • Merge Sorted Arrays
    • Queue using stacks
    • Factorial
    • Fibonacci Series
    • Reversing a Linked List
    • Check if given tree is BST
    • Matching brackets problem
    • LRU Cache Algorithm (using Array | using Linked List)
    • Snakes And Ladders game

References: