This repository contains some simple scripts I made just to improve my programming skills. Also there are solutions for common interview questions.
This script contains three functions to calculate Pi. Scripts measures time evaluated to calculate n numbers of Pi using different functions. I used three formulas:
- Bellard's formula:
- Bailey-Borwein-Plouff formula:
- Chudnovsky formula:
This script contains useful functions I used for my cryptography related projects such as generating random prime numbers, factorization of numbers etc.
This script contains three functions to calculate integrals:
4. Calculator
Every beginner programmer must write its own calculator, so here is mine.
This script contains one function that implements searching of the subbarray with highest sum of elements. Example:
array: 1 2 3 -9 9 1 -2
max_subarray: 9 1
6. sort.py
This script contains different sorting algorithm implementations.
7. fibonacci.py
This script contains two functions to calculate n-th number of Fibonacci sequence - slow and fast realisations. Also there is a function to calculate Pisano period and a function for fast calculation of Fn mod m.