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
/* | |
* 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> |
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/dynamic-programming-set-8-matrix-chain-multiplication/ | |
* 2) https://home.cse.ust.hk/~dekai/271/notes/L12/L12.pdf | |
* 3) http://www.bowdoin.edu/~ltoma/teaching/cs231/spring14/Lectures/12-dynamicAndGreedy/matrixchain.pdf | |
* | |
**/ |
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
def bin_search(lis, x): | |
lo, hi = 0, len(lis)-1 | |
while lo < hi: | |
mid = int((hi+lo)/2) | |
if lis[mid] >= x: | |
hi = mid | |
else: |
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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
class segmentTree { | |
private: |
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 <bits/stdc++.h> | |
using namespace std; | |
class BIT { | |
private: | |
vector<int> bit; | |
int n; | |
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
javascript: [].forEach.call(document.querySelectorAll('.torrent'), function (el) { el.style.display = 'block'; }); |