Skip to content

Instantly share code, notes, and snippets.

View jtechidd's full-sized avatar

Techid Janphaka jtechidd

  • Alpha Innovations Lab
  • Thailand
  • 17:05 (UTC +07:00)
View GitHub Profile
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#define MAX(a, b) ((a > b) ? a : b)
typedef struct node_t node_t;
struct node_t {
int value;
#include <stdio.h>
#include <stdlib.h>
typedef struct node_t node_t;
struct node_t {
int value;
node_t *parent;
node_t *left;
node_t *right;
@jtechidd
jtechidd / print256colours.sh
Created March 28, 2020 11:37 — forked from HaleTom/print256colours.sh
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
//Author: techid2000
#include <bits/stdc++.h>
#pragma region ◄ Helper ►
#define foru(i, a, b) for(int i = a; i <= b; ++i)
#define ford(i, a, b) for(int i = a; i >= b; --i)
#define rep(i,a) for(int i = 0; i < a; i++)
#define minheap(x) x,vector<x>,greater<x>
#define X first
#define Y second
#define watch(x) cerr << #x << " = " << x << '\n'