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
/* | |
* ===================================================================================== | |
* | |
* Filename: Data_Mining-Association_Rule-Apriori.cpp | |
* | |
* Description: Data Mining - Association Rule | |
* Apriori C++ Implementation | |
* | |
* Compiler: g++ | |
* Platform: OS X 10.7 |
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
bool DFS( int now, int cnt ) { | |
visit[ now ] = 1; | |
bool ret = 0; | |
if ( now == tgA ) | |
ret = BFS( 1 ); | |
if ( !cnt || ret ) { | |
visit[ now ] = 0; | |
return ret; | |
} |
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 <cstdio> | |
#include <cstdlib> | |
using namespace std; | |
#define MAX 1000000 | |
bool isNotPrime[ MAX + 1 ]; | |
void sieve() { | |
memset( isNotPrime, 0, sizeof( isNotPrime ) ); | |
isNotPrime[ 0 ] = isNotPrime[ 1 ] = 1; | |
for ( int i = 2; i <= MAX; i += 2 ) | |
isNotPrime[ i ] = 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
#include <iostream> | |
#include <cstdio> | |
#include <cstdlib> | |
using namespace std; | |
long long int MAX; | |
long long int count( int x ) { | |
if ( x == 1 ) | |
return 0; |
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
const char* toExcelColumnName( int n ) { | |
string ret = ""; | |
while ( n ) { | |
int x = n % 26; | |
if ( x ) | |
ret += 'A' + x - 1; | |
else | |
ret += 'Z', n -= 26; | |
n /= 26; | |
} |
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 <cstdio> | |
#include <algorithm> | |
#include <queue> | |
#include <vector> | |
using namespace std; | |
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 <iostream> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <map> | |
#include <string> | |
#include <cstring> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
#define MAXN 110 |
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 <algorithm> | |
#include <cstdio> | |
#include <cstdlib> | |
using namespace std; | |
struct POINT { | |
int x; | |
bool end; | |
double c; |
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 <cstdio> | |
#include <cstdlib> | |
#include <algorithm> | |
using namespace std; | |
int pos[ 10010 ]; | |
int main() { | |
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
#include <iostream> | |
#include <map> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <algorithm> | |
using namespace std; | |
struct POINT { | |
int x, y; | |
bool operator< ( const POINT r ) const { | |
return ( x < r.x ) || ( x == r.x && y < r.y ); |
OlderNewer