GithubHelp home page GithubHelp logo

jshivam / dsa-swift Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 6.0 269 KB

Data Structures and Algorithms in Swift

Swift 100.00%
swift dsa-swift algorithms leetcode dsa tree stack queue array dynamic-programming linked-list graph heap trie

dsa-swift's Introduction

DSA-Swift

Data Structures and Algorithms in Swift

Note: Most of problems have been picked from leetcode.

Language

  • Swift 5.0

Data Structure

Tree

  1. Diameter of Binary Tree
  2. Invert Binary Tree
  3. Kth Smallest Element in a BST
  4. LCA of a Binary Tree
  5. Level Order Traversal
  6. Maximum Depth of Binary Tree
  7. Maximum Path Sum
  8. MinimunDepth
  9. Shortest distance between two nodes in BST
  10. Validate Binary Search Tree
  11. VerticalOrderTraversal
  12. Sum Tree
  13. Binary Tree Paths
  14. Recover Binary Search Tree
  15. LCA of a BST
  16. Unique Binary Search Trees
  17. Convert Sorted Array to Binary Search Tree
  18. Construct Binary Tree from Preorder and Inorder Traversal
  19. Boundary Traversal Of Binary Tree

Array

  1. Binary Search
  2. Jump Game
  3. Kth Largest Element
  4. Subarray Sum Equals K
  5. Subsets
  6. Minimum Window Substring
  7. Sort Colors
  8. Frequencies of array elements in range 1 to n
  9. Delete Products
  10. K-diff Pairs in an Array
  11. Maximum Product Sum Among All Rotations
  12. Minimum Swaps To Sort An Array
  13. Two Sum
  14. Longest Common Prefix
  15. Group Anagrams
  16. Maximum Subarray
  17. Longest Consecutive Sequence
  18. Merge Intervals
  19. Find Peak Element
  20. SmallestPositiveInteger
  21. Gas Station
  22. 3Sum Smaller
  23. Minimum Remove to Make Valid Parentheses
  24. Search in Rotated Sorted Array
  25. Minimum Subarray With Required Sum
  26. Longest Substring Of All Vowels in Order

Cache

  1. LRUCache
  2. Insert Delete GetRandom in O(1)

Dynamic Programming

  1. Partition Equal Subset Sum
  2. Maximum Sum Subsequence NonAdjacent
  3. Coin Change
  4. Climbing Stairs
  5. Best Time to Buy and Sell Stock
  6. House Robber
  7. Edit Distance
  8. Longest Increasing Subsequence
  9. Longest Common Subsequence

Graph

  1. WordLadder

Backtracking

  1. Permutations
  2. Generate Parentheses

LinkList

  1. LinkList
  2. Reorder List

Math

  1. Count Primes
  2. Palindrome Number
  3. Power
  4. Valid Number
  5. Square Root of Number

Matrix

  1. Diagonal Traverse
  2. Spiral Matrix
  3. Set Matrix Zeroes
  4. Search a 2D Matrix II
  5. Number of Islands
  6. Unique Paths

Queue

  1. Queue

Stack

  1. Valid Parentheses

Sorting

  1. QuickSort
  2. MergeSort

Heap

  1. Heap

Tri

  1. Tri

dsa-swift's People

Contributors

jshivam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dsa-swift's Issues

Make it a Package

These is an impressive list of data structure implementations. Some of them would be useful as dependencies in other projects. Add a Swift.package so that it can be included in other projects like this:

.package(url: "https://github.com/tensorflow/swift.git", .branch("master")),

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.