GithubHelp home page GithubHelp logo

swift4algo's Introduction

Swift4Algo

Simple Swift 4 Algorithms

  • RegEx
  • Hanoi Towers
  • Cycled Linked List check
  • Find N Ordered element of a unsorted array
  • ASCII to Int
  • Find the only heavier coin in a group of 8 coins
  • Deck Shuffling (randomize existing array)
  • Path Between Nodes in a Tree
  • Coin Flipping and Die Rolls (Random Int using random bit generator)
  • Boyer Moore String Search
  • Levenshtein
  • Array Rotate Left
  • Trees: Is This a Binary Search Tree?
  • Tries: Contacts
  • Strings: Making Anagrams
  • Get Products Of All Array Except At Index with NO Division
  • Rectangles Intersection
  • Queue with 2 Stacks
  • Heaps: Find the Running Median
  • BST: Second Greatest
  • BinarySearch: Find Rotation Point on Sorted but Rotated array
  • Fibonacci: Recursive vs Dynamic vs Linear
  • Trees: Compare two trees using a depth first search
  • Sort: bucketSort, radixSort, quickSort, heapSort, mergeSort, selectionSort, insertionSort, bubbleSort
  • Bitwise op XOR: Find The Unique Non Duplicate ID(Int) in an Array full of duplicate IDs (Int) except one
  • Reverse Forward Linked List
  • Last n Element of a Forward Linked List
  • Island in a Matrix (Graph)
  • Duplicate in stream of integers from 1 to n (no memory)
  • EggsDrop: N eggs, what's the highest floor from which you can drop the egg without breaking it
  • IPDuplicates: Given a stream of IPv4 addresses find all IPs that occurred only once
  • Triplette: Given an array of distinct elements find triplets in the array whose sum is zero.
  • LRU Cache: Implement a Last Recently Used Key Value Cache

WORK IN PROGRESS, more coming

Single Swift file for each algorith with embedded sample usage / testing logic

To try it please install Swift 4 | XCode 9 and just use swift [file name].swift on terminal

swift4algo's People

Contributors

jacopomangiavacchi avatar

Watchers

James Cloos avatar Farrukh Askari avatar

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.