Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Paul Lewallen paullewallencom

🎯
Focusing
View GitHub Profile
@paullewallencom
paullewallencom / gist:93973fc0750d7e42dec3fdb1812475ac
Created Dec 19, 2020
GitHub GraphQL API: Fetch Repository Count for Current User
View gist:93973fc0750d7e42dec3fdb1812475ac
<!-- https://docs.github.com/en/free-pro-team@latest/graphql/overview/explorer -->
query {
viewer {
repositories(isFork: false) {
totalCount
}
}
}
<!-- RESULTS -->
@paullewallencom
paullewallencom / main.app
Created Feb 6, 2019
Read Only One (1) 'char' From 'cin'
View main.app
#include <iostream>
#include <iomanip>
#include <fstream>
#include <termios.h>
#include <stdio.h>
using namespace std;
int main( int argc, const char *argv[] )
{
View Treap.h
#ifndef TREAP_H
#define TREAP_H
#include <climits>
#include "UniformRandom.h"
#include "dsexceptions.h"
#include <iostream>
using namespace std;
@paullewallencom
paullewallencom / RedBlackTree.h
Created Jul 31, 2018
Top-Down Red Black Tree
View RedBlackTree.h
#ifndef RED_BLACK_TREE_H
#define RED_BLACK_TREE_H
#include "dsexceptions.h"
#include <iostream>
using namespace std;
template <typename Comparable>
class RedBlackTree
View SplayTree.h
#ifndef SPLAY_TREE_H
#define SPLAY_TREE_H
#include "dsexceptions.h"
#include <iostream>
using namespace std;
template <typename Comparable>
class SplayTree
{
View RadixSort.cpp
#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;
View BinomialQueue.h
#ifndef BINOMIAL_QUEUE_H
#define BINOMIAL_QUEUE_H
#include <iostream>
#include <vector>
#include "dsexceptions.h"
using namespace std;
template <typename Comparable>
class BinomialQueue
View LeftistHeap.h
#ifndef LEFTIST_HEAP_H
#define LEFTIST_HEAP_H
#include "dsexceptions.h"
#include <iostream>
using namespace std;
template <typename Comparable>
class LeftistHeap
{
View BinaryHeap.h
#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 Jul 31, 2018
Quadratic Probing Hash Table
View QuadraticProbing.cpp
#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 )