Skip to content

Instantly share code, notes, and snippets.

View ckalbas's full-sized avatar

Carlos Kochhann ckalbas

  • Serpro
  • Brasília, DF
View GitHub Profile
@ckalbas
ckalbas / BST.cc
Created February 27, 2018 18:18
Binary Search Tree example in C++
#include <iostream>
/**
* Binary Search Tree Node structure
*/
using namespace std;
struct Node
{
int value;
@ckalbas
ckalbas / Heapsort-Loop.cc
Created February 25, 2018 18:17
Heapsort algorithm using recursive and loop solutions in C++
#include <stdio.h>
#include <iostream>
#define LENGTH 10
int heapSize = 0;
using namespace std;
void Exchange(int* A, int a, int b)
{
@ckalbas
ckalbas / Timeago-ahead.swift
Last active June 28, 2017 23:49
"Time ago" em Swift
/// Based on https://gist.github.com/jinthagerman/009c85b7bbd0a40dcbba747e89a501bf
import UIKit
struct DateComponentUnitFormatter {
private struct DateComponentUnitFormat {
let unit: Calendar.Component
let singularUnit: String
let pluralUnit: String