Skip to content

niakrise/Algorithms-in-examples

Repository files navigation

Algorithms in examples

Swift solutions for popular algorithms:

  1. FizzBuzz algorithm.
Implement algorithm that display numbers from 1 to N.
For any number that is divisible by 3 print out the word Fizz.
For any number that is divisible by 5 print out the word Buzz.
Finally, if number is divisible by both numbers print out FizzBuzz.
  1. Binary search.
Given array of integers. You have to search through this array and you also have to return true if you found the search value inside this array, otherwise you have to return false.
  1. Factorials
Implement factorial function
  1. Most common name in array
Implement algorithm, which find most common name in array
  1. Reverse every other word
Implement a function that returns this same sentence with every other word reversed.

License

Source code is distributed under MIT license.

About

Swift solutions for algorithms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages