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
import functools | |
import math | |
import numpy as np | |
class PowerSeriesSubsetSum(IDeterministicAlgorithm): | |
@classmethod | |
def run(self, values, target): | |
return self.polynomialEncoding(values, target) |
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
import java.awt.*; import java.awt.event.*; | |
import javax.swing.*; import java.util.*; | |
class Histogram extends Frame { | |
int length; | |
int xStart; | |
int xDistance; | |
int[] y; // Vi skal lige bruge den her... | |
String[] x; | |
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
// Der er 4 klasser indtil videre. | |
// Dette er den første klasse, som skal bruges til at initialisere alle "scenarierne" baseret på de valg man tager: | |
import java.util.HashMap; | |
/** | |
* Lav en beskrivelse af klassen Scenarios her. | |
* | |
* @author (dit navn her) | |
* @version (versions nummer eller dato her) |
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
public class Polynomial | |
{ | |
double[] cs; | |
int typeLigning; | |
public Polynomial(double[] cs) { | |
this.cs = cs; | |
typeLigning = cs.length - 1; | |
} |
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
import java.util.ArrayList; | |
public class BigForest { | |
private ArrayList<Tree> trees; | |
private int a; | |
public BigForest() // Opgave i | |
{ | |
trees = new ArrayList<>(); |
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
// Hej, hvordan får jeg min kode til at returnere ciffrene uden at skifte linje? | |
public class Quadratic{ | |
// Opgave i | |
private double a; | |
private double b; | |
private double c; | |
private double x; | |
private double d; | |