Skip to content

Instantly share code, notes, and snippets.

View nitko12's full-sized avatar

Zvonimir Haramustek nitko12

  • Osijek / Zagreb
View GitHub Profile
@nitko12
nitko12 / AATree.hpp
Last active November 30, 2024 12:59
AA Tree key (K) value (V) store single header implementation with subtree sum (S) query in log n (log n pooled allocations)
// BSD Zero Clause License
// Copyright (c) 2024 nitko12
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted.
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
@nitko12
nitko12 / radix_sort.c
Created June 16, 2022 13:35
Testing simple radix sort implementation against qsort
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
const int MAXN = 100000;
int buf1[64][MAXN], buf2[64][MAXN], cnt[64], cnt2[64];
long long used;
@nitko12
nitko12 / branch_tree_itoa.cpp
Created June 16, 2022 13:30
Testing itoa speeds of semi naive unrolled approach againt jeaiii black magic code
#include <random>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "jeaiii_to_text.h.h"
using namespace std;
using namespace jeaiii;
void itoa_test(unsigned int n, char *s)