This file contains 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 <stdio.h> | |
void int2bin(int n, int base) { | |
if(n > 0) { | |
int2bin(n / base, base); | |
printf("%d ", n % base); | |
} | |
} | |
int main() { |
This file contains 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 <stdio.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define SIZE 8 | |
int base[SIZE][SIZE]; | |
void shuffle(int arrayNum[]) { |
This file contains 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 <stdio.h> | |
#include <stdbool.h> | |
#define N 6 | |
// 0 = valid box to step | |
// x = invalid box to step (halangan) | |
char board[N][N] = { | |
{ 0 ,'x','x','x','x','x'}, | |
{ 0 , 0 , 0 ,'x', 0 ,'x'}, |
This file contains 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
#!/usr/bin/env bash | |
# Author : shahril96 | |
# Licensed under the WTFPL license - http://www.wtfpl.net/about/ | |
# Make sure only root can run our script | |
[[ $EUID -ne 0 ]] && { echo "This script must be run as root" 1>&2; exit 1; } | |
# print help msg if not enough argument given | |
[ $# -ne 1 ] && { echo "Usage: `basename $0` port-to-listen"; exit 1; } |
This file contains 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
# set ctrl-b for sending prefix | |
set-option -g prefix ^B | |
bind-key ^B send-keys ^B | |
set -g default-terminal "screen-256color" | |
bind | split-window -h | |
bind - split-window -v | |
bind N break-pane |
This file contains 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
" --------------------------------------------- | |
" | |
" Do this beforehand : | |
" | |
" $ git clone https://github.com/VundleVim/Vundle.vim.git | |
" ~/.vim/bundle/Vundle.vim | |
" | |
" If you have upgraded your YCM, then follow instruction from line (/search .ycm.extra_conf.py) | |
" if you want C-family auto-complete feature |
This file contains 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
# Don't display the copyright page | |
startup_message off | |
# change default key binding to ctrl+b | |
escape ^Bb | |
# enable 256-bit color instead of default 8-bit colors | |
term screen-256color | |
hardstatus alwayslastline |
This file contains 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
/* | |
* references | |
* 1) http://www.geeksforgeeks.org/greedy-algorithms-set-2-kruskals-minimum-spanning-tree-mst/ | |
* 2) https://en.wikipedia.org/wiki/Kruskal%27s_algorithm | |
*/ | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; |
This file contains 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
/* | |
* references | |
* | |
* 1) http://www.geeksforgeeks.org/greedy-algorithms-set-5-prims-minimum-spanning-tree-mst-2/ | |
* 2) https://www.cse.ust.hk/~dekai/271/notes/L07/L07.pdf | |
* | |
*/ | |
#include <iostream> | |
#include <set> |
This file contains 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
/* | |
* references | |
* | |
* 1) http://www.geeksforgeeks.org/greedy-algorithms-set-6-dijkstras-shortest-path-algorithm/ | |
* 2) http://home.cse.ust.hk/faculty/golin/COMP271Sp03/Notes/MyL09.pdf | |
* | |
*/ | |
#include <iostream> | |
#include <set> |