Skip to content

Instantly share code, notes, and snippets.

View luizfls's full-sized avatar

Luiz Felipe Silva luizfls

View GitHub Profile
@luizfls
luizfls / heapsort.cpp
Created April 26, 2021 00:29
Heapsort without make_heap
void heapsort(std::vector<int>& v)
{
std::vector<int> u;
for(auto i : v)
{
u.push_back(i);
std::push_heap(u.begin(), u.end(), std::greater<int>{});
}
for(auto& i : v)
{
@luizfls
luizfls / PLA.cpp
Last active October 8, 2017 19:44
CS156 HW1 (perceptron)
#include <random>
#include <cmath>
#include <limits>
#include <vector>
#include <algorithm>
#include <iostream>
#define N 100
#define N_VALIDATION 100000
#define N_RUNS 1000