Skip to content

Instantly share code, notes, and snippets.

%!PS-Adobe-3.0 EPSF-3.0
%%Creator: cairo 1.14.6 (http://cairographics.org)
%%CreationDate: Tue Nov 29 11:56:20 2016
%%Pages: 1
%%DocumentData: Clean7Bit
%%LanguageLevel: 2
%%BoundingBox: 6 179 595 688
%%EndComments
%%BeginProlog
save
int parent(int i)
{
return i/2;
}
int left(int i)
{
return i*2;
#include <stdio.h>
#include <vector>
#include <assert.h>
#include <iostream>
#include <math.h>
using namespace std;
bool isprime(int n)
{
#include <stdio.h>
#include <vector>
#include <iostream>
#include <cassert>
template <typename T>
struct rbtree
{
enum Color {
#include <stdio.h>
#include <vector>
#include <iostream>
#include <cassert>
using namespace std;
bool serach(int x, vector<int> array)
{
for (int i=0;i<array.size();i++) {
#include <stdio.h>
template <typename T>
class bilst
{
struct node {
node *next;
node *prev;
T val;
#include <stdio.h>
template <typename T>
class list
{
struct node {
node *next;
node *prev;
T val;
};
#include <iostream>
#include <vector>
#include <stdio.h>
void p(int *array,int n)
{
for (int i=0;i<n;i++) {
printf("%d ",array[i]);
}
printf("\n");
#include <vector>
#include <queue>
#include <list>
#include <iostream>
using namespace std;
typedef pair<int,int> ii;
#include <stdio.h>
#include <map>
#include <vector>
#include <iostream>
using namespace std;
template<typename T>
class List {
struct Node {