This file contains 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
def gcd(a, b): | |
""" | |
An efficient algorithm to compute GCD \n | |
a is a number \n | |
b is the other number \n | |
no other arguments | |
""" | |
if b == 0: | |
return a | |
ap = a % b |
This file contains 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
def gcd(a, b): | |
""" | |
An efficient algorithm to compute GCD \n | |
a is a number \n | |
b is the other number \n | |
no other arguments | |
""" | |
if b == 0: | |
return a | |
ap = a % b |
This file contains 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
class Fibonacci { | |
/** | |
* Fibonacci class | |
* A collection of functions | |
*/ | |
constructor() { | |
/** | |
* No variables for this constructor | |
*/ | |
console.log("Welcome to the Fibonacci class"); |
This file contains 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
from numbers import * | |
from strings import * | |
def print_instructions(): | |
print("Welcome") | |
print("0 - Print instructions") | |
print("1 - Choose a number function") | |
print("2 - Choose a string function") | |
print("3 - Exit the program") |
This file contains 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
# Uses python3 | |
import sys | |
from functools import reduce | |
def get_change(m): | |
""" | |
:type m: int | |
:param m: | |
:return: int |
This file contains 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
package com.sharan; | |
import java.math.BigInteger; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.List; | |
/** | |
* There is nothing for lists yet except for an empty | |
* constructor |
This file contains 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
def sort(l): | |
""" | |
Sorts a list | |
:param l: | |
:return: l_sorted | |
""" | |
l_copy = l.copy() | |
l_sorted = [] | |
for i in range(0, len(l_copy)): | |
minimum = reduce(min, l_copy) |
This file contains 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
class BarChart { | |
constructor(_element, _data, _x, _y, _title, _xs, _ys) { | |
this.element = _element; | |
this.parent = $(_element) | |
this.data = _data; | |
this.xv = _x; | |
this.yv = _y; | |
this.title = _title; | |
this.xs = _xs; | |
this.ys = _ys; |
This file contains 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
license: mit | |
border: no | |
scrolling: yes |
This file contains 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
license: mit | |
border: no | |
scrolling: yes |
OlderNewer