This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <limits> | |
using namespace std; | |
void merge(vector<int> & data, int p, int q, int r) { | |
// merge data[p..q] and data[q+1..r] | |
int n1 = q - p + 1; | |
int n2 = r - q; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
using namespace std; | |
void selection_sort(vector<int> & data) { | |
for (int i = 0; i < data.size() - 1; i++) { | |
// find ith smaller data | |
int min = i; | |
for (int j = i + 1; j < data.size(); j++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
using namespace std; | |
void insertion_sort (vector<int>& data) { | |
for (int i = 1; i < data.size(); i++) { | |
// insert data[i] into data[0..i-1] | |
int key = data[i]; | |
int j = i - 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
#include <vector> | |
#include <string> | |
#include <functional> | |
int numlines; | |
std::string _1st_seg, _2nd_seg; | |
std::vector<std::string> vec_output; | |
std::vector<bool> vec_endpoints; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
using namespace std; | |
vector<int> arr_to_hp; | |
vector<int> hp_to_arr; | |
vector<int> hp; | |
void max_heapify(int i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by Yanzhe Chen on 5/25/14. | |
// | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
int partition(vector<int> &array, int head, int tail); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(provide (all-defined-out)) ;; so we can put tests in a second file | |
;; put your code below | |
;; Problem 1 | |
(define (sequence low high stride) | |
(if (> low high) | |
null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# witch panes in vim way | |
unbind-key j | |
bind-key j select-pane -D | |
unbind-key k | |
bind-key k select-pane -U | |
unbind-key h | |
bind-key h select-pane -L | |
unbind-key l | |
bind-key l select-pane -R |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG v2.0.22 (Darwin) | |
mQENBFM34rwBCADmQj29ZJcmpqD879BOH+NLFxcjsaOdoA2cEyUDncfxU8bHcp0I | |
7zYyrUJI0q3qzw2wtlW90MgMamGTbPy3Ge13mTG6WiEPc55Cd1cteKZg4+CH9S2s | |
e1ipboAe2ZdhQs43vjEWd3jGku2+fvPF8RbuUvHiYrN6j6ruSn0PF4kDDoDkTQKM | |
j46r7blNoeM4DOjOHEzb0n6oU98ybUUiDAmnGrspBgfo2JyfJZKsBZVdjGnUxA77 | |
EdKRfe9LTZJuEkymi+F/Mk4kKICzmA3XycfLTtxJRvBrtGFPObgWGYpPCWN2kDc6 | |
UsvewT03XNT+FLsJWm5Kevkc+AmpYhddl5rVABEBAAG0MFlhbnpoZSBDaGVuIChr | |
ZXkgZm9yIHBhc3MpIDx5YW56aGUuY25AZ21haWwuY29tPokBOQQTAQIAIwUCUzfi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brick10 /rack0 | |
brick11 /rack0 | |
brick12 /rack1 | |
brick13 /rack1 | |
192.168.13.171 /rack0 | |
192.168.10.61 /rack0 | |
192.168.13.144 /rack1 | |
192.168.12.78 /rack1 |