Skip to content

Instantly share code, notes, and snippets.

View Higgcz's full-sized avatar
:octocat:

Vojtech Micka Higgcz

:octocat:
  • NNAISENSE
  • Lugano
View GitHub Profile
@Higgcz
Higgcz / gist:3875195
Created October 11, 2012 20:14
Getting classification tresholds.
function [treshold, direction] = classificationTreshold(D1, D2)
meA=D1.Mean;
siA=D1.Sigma;
meC=D2.Mean;
siC=D2.Sigma;
hlavni = (siC^2-siA^2);
funA = [
hlavni
@Higgcz
Higgcz / coinChange.cpp
Created October 5, 2012 18:34
Number of combination for coins changing
#include <iostream>
long change(const int sum, const int coins[], const int size) {
if ( sum == 0 ) return 0;
if ( coins == NULL || size == 0 ) return 0;
long * out = new long[sum + 1];
out[0] = 1;
@Higgcz
Higgcz / gist:3810770
Created October 1, 2012 10:26
Given a specified total t and a list of integers, find all distinct sums using numbers from the list that add up to t. Use findSum(t, given_numbers, new LinkedList<Integer>())
public static LinkedList<LinkedList<Integer>> findSum(int t, LinkedList<Integer> input, LinkedList<Integer> used) {
LinkedList<LinkedList<Integer>> inner, out = new LinkedList<LinkedList<Integer>>();
Integer sum = 0, temp;
LinkedList<Integer> usedBk, inputBk = (LinkedList<Integer>) input.clone();
while ( !inputBk.isEmpty() ) {
temp = inputBk.poll();
if ( temp == sum ) {