Skip to content

Instantly share code, notes, and snippets.

View paullewallencom's full-sized avatar
🎯
Focusing

Paul Lewallen paullewallencom

🎯
Focusing
View GitHub Profile
@paullewallencom
paullewallencom / gist:93973fc0750d7e42dec3fdb1812475ac
Created December 19, 2020 20:54
GitHub GraphQL API: Fetch Repository Count for Current User
<!-- https://docs.github.com/en/free-pro-team@latest/graphql/overview/explorer -->
query {
viewer {
repositories(isFork: false) {
totalCount
}
}
}
<!-- RESULTS -->
@paullewallencom
paullewallencom / main.app
Created February 6, 2019 14:56
Read Only One (1) 'char' From 'cin'
#include <iostream>
#include <iomanip>
#include <fstream>
#include <termios.h>
#include <stdio.h>
using namespace std;
int main( int argc, const char *argv[] )
{
#ifndef TREAP_H
#define TREAP_H
#include <climits>
#include "UniformRandom.h"
#include "dsexceptions.h"
#include <iostream>
using namespace std;
@paullewallencom
paullewallencom / RedBlackTree.h
Created July 31, 2018 20:49
Top-Down Red Black Tree
#ifndef RED_BLACK_TREE_H
#define RED_BLACK_TREE_H
#include "dsexceptions.h"
#include <iostream>
using namespace std;
template <typename Comparable>
class RedBlackTree
@paullewallencom
paullewallencom / SplayTree.h
Created July 31, 2018 20:46
Top-Down Splay Tree
#ifndef SPLAY_TREE_H
#define SPLAY_TREE_H
#include "dsexceptions.h"
#include <iostream>
using namespace std;
template <typename Comparable>
class SplayTree
{
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include "UniformRandom.h"
using namespace std;
void radixSortA( vector<string> & arr, int stringLen )
{
const int BUCKETS = 256;
#ifndef BINOMIAL_QUEUE_H
#define BINOMIAL_QUEUE_H
#include <iostream>
#include <vector>
#include "dsexceptions.h"
using namespace std;
template <typename Comparable>
class BinomialQueue
#ifndef LEFTIST_HEAP_H
#define LEFTIST_HEAP_H
#include "dsexceptions.h"
#include <iostream>
using namespace std;
template <typename Comparable>
class LeftistHeap
{
#ifndef BINARY_HEAP_H
#define BINARY_HEAP_H
#include "dsexceptions.h"
#include <vector>
using namespace std;
template <typename Comparable>
class BinaryHeap
{
@paullewallencom
paullewallencom / QuadraticProbing.cpp
Created July 31, 2018 20:25
Quadratic Probing Hash Table
#include "QuadraticProbing.h"
#include <iostream>
using namespace std;
bool isPrime( int n )
{
if( n == 2 || n == 3 )
return true;
if( n == 1 || n % 2 == 0 )