Skip to content

Instantly share code, notes, and snippets.

//search the element which has the minimal abs value in an ascending array
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int minabs(vector<int> &a, int start, int end){
if(start+1 == end){
return a[start];
//double linked list insertion and deletion
//lrj whitebook p95
#include <iostream>
using namespace std;
struct Node{
int value;
Node* left;
Node* right;
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
const int MAXD = 20;
vector<bool> tree(1<<20, true);
int main(){
#include <iostream>
#include <vector>
#include <cassert>
using namespace std;
const int MAXD = 20;
vector<bool> tree(1<<20, true);
int main(){
// transverse a tree based on levels
// Lrj's whitebook p102
#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
struct Node{
// construct the post transverse based on the preorder and inorder transverse
// lrj whitebook p106
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
using namespace std;
const int MAXN = 100;
# $Id: PKGBUILD 110725 2011-02-21 20:11:19Z tpowa $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
pkgname=qemu-mit6828
pkgver=15497.04885f1
pkgrel=1
pkgdesc="QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation.This version is specified for MIT's operating system lesson(6.828)"
arch=('i686' 'x86_64')
license=('GPL2' 'LGPL2.1')
url="http://wiki.qemu.org/Index.html"
makedepends=('perl' 'git')
# Contributor: Cyril Lashkevich <notorca at gmail dot com>
pkgname=kchmviewer-qt
pkgver=6.0
pkgrel=3
pkgdesc="A .chm files (MS HTML help file format) viewer"
arch=('i686' 'x86_64')
url="http://kchmviewer.sourceforge.net/"
license=('GPL')
depends=('chmlib' 'qtwebkit')
[Desktop Entry]
Categories=Qt;KDE;Utility;
Encoding=UTF-8
Type=Application
Exec=kchmviewer %U
Icon=kchmviewer.png
Comment=
Terminal=0
Name=KchmViewer
Comment=A viewer of CHM (MS-Help) files
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cstdio>
using namespace std;
enum WarriorType{
DRAGON, NINJA, ICEMAN, LION, WOLF