Skip to content

Instantly share code, notes, and snippets.

View EduardoVaca's full-sized avatar

EduardoVaca EduardoVaca

  • Microsoft
View GitHub Profile
public class Ingredient{
public enum Units {ML, CUPS, SPOONS, QUARTS, GRAMS};
private String name;
private double quantity;
private Units unit;
public Ingredient(String name, double quantity, Units unit){
/*Go functions may be closures. A closure is a function value that references variables from outside its body.
The function may access and assign to the referenced variables; in this sense the function is "bound" to the variables.
Implement a fibonacci function that returns a function (a closure) that returns successive fibonacci numbers.*/
package main
import "fmt"
// fibonacci is a function that returns
public class TreeDictionary{
private NodeTreeDictionary root;
private class NodeTreeDictionary{
char letter;
HashMap<char, NodeTreeDictionary> children;
String shortestWord;