This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * | |
| * Author : Adrian Statescu mergesortv@gmail.com http://adrianstatescu.com | |
| * | |
| * Description: C Program to compute PI using a Monte Carlo Method. | |
| * | |
| * MIT License | |
| * | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * | |
| * Adrian Statescu (http://adrianstatescu.com) | |
| * | |
| * Euclid's algorithm is an efficient method for computing the greatest common divisor of two numbers, I mean the largest number that divides both of them without leaving a remainder. | |
| * | |
| * License MIT | |
| * | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * | |
| * Author : Adrian Statescu mergesortv@gmail.com http://adrianstatescu.com | |
| * | |
| * Description: BubbleSort is a simple sorting algorithm that repeatedly steps through the elements | |
| * in an array to be sorted, compares each pair of adjiacent elements and swap thems | |
| * if they are in the wrong order. | |
| * The pass through the list is repeated until no more changes swaps are needed. | |
| * | |
| * Complexity : Worst-case O(n^2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * | |
| * Author : Adrian Statescu mergesortv@gmail.com http://adrianstatescu.com | |
| * | |
| * Description: BubbleSort is a simple sorting algorithm that repeatedly steps through the elements | |
| * in an array to be sorted, compares each pair of adjiacent elements and swap thems | |
| * if they are in the wrong order. | |
| * The pass through the list is repeated until no more changes swaps are needed. | |
| * | |
| * Complexity : Worst-case O(n^2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * | |
| * Author : Adrian Statescu mergesortv@gmail.com http://adrianstatescu.com | |
| * | |
| * Description: BubbleSort is a simple sorting algorithm that repeatedly steps through the elements | |
| * in an array to be sorted, compares each pair of adjiacent elements and swap thems | |
| * if they are in the wrong order. | |
| * The pass through the list is repeated until no more changes swaps are needed. | |
| * | |
| * Complexity : Worst-case O(n^2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Adrian Statescu <mergesortv@gmail.com> (http://adrianstatescu.com) | |
| * | |
| * Approximation of PI using Leibniz method. | |
| * 1-1/3+1/5-1/7 | |
| * | |
| * Compile and Run -> go run leibniz_pi.go | |
| * | |
| * License: MIT | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Adrian Statescu <mergesortv@gmail.com> http://adrianstatescu.com | |
| # Computes PI using Leibniz method | |
| # MIT License | |
| def PI ep | |
| anEPS = ep | |
| term1 = 1.0 | |
| term2 = 1.0 - 1.0/3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Author: Adrian Statescu <mergesortv@gmail.com> http://adrianstatescu.com | |
| * Description: Quadratic Equation Solver in ANSI C Language | |
| * MIT License | |
| */ | |
| #include <stdio.h> | |
| #define FIN "quadratic.in" | |
| #define FOUT "quadratic.out" | |
| #define MAXEQ 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Adrian Statescu <mergesortv@gmail.com> http://adrianstatescu.com | |
| # Quadratic Equation Solver | |
| # MIT License | |
| # | |
| require "cmath" | |
| def quadratic | |
| arr = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Adrian Statescu <mergesortv@gmail.com> http://adrianstatescu.com | |
| # Number's Euler e = 2.7182... | |
| # MIT License | |
| # | |
| def fact n | |
| if n == 0 | |
| 1 | |
| else |