Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 1.04 KB

File metadata and controls

21 lines (14 loc) · 1.04 KB

What's in this repo

This repo contains the implementation of some algorithms in pyton and details regarding their speed based on the Big O notation.

"Rock Paper Scissors Lizard Spock" game

Binary Search

When we search for an element using simple search, in the worst case we might have to look at every single element. So for a list of 8 numbers, we'd have to check 8 numbers at most. For binary search, we have to check log n elements in the worst case. For a list of 8 elements, log 8 == 3, because 2 cubed == 8. So for a list of 8 numbers, we would have to check 3 numbers at most. O(log n) => log time.

SelectionSort

O(n*n)

Notes for Repl.it use on Windows: workspaces are in a Linux enviroment - and paste in Linux -> Ctrl + Shift +

References

  • Grokking Algorithms: An illustrated guide for programmers and other curious people by Aditya Y. Bhargava