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 <dlib/gui_widgets.h> | |
#include <dlib/image_io.h> | |
#include <dlib/image_transforms.h> | |
#include <fstream> | |
using namespace std; | |
using namespace dlib; | |
// ---------------------------------------------------------------------------- |
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 <Windows.h> | |
#include <iostream> | |
#include <opencv2/highgui.hpp> | |
#include <opencv2/imgproc.hpp> | |
#include <opencv2/video/background_segm.hpp> | |
#include <opencv2\video\tracking.hpp> | |
int main(int argc, char** argv) |
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> | |
// Print all elemets in array | |
void print(int A[], int N) | |
{ | |
for (int i = 0; i < N; i++) { | |
if (i != 0) | |
std::cout << " "; | |
std::cout << A[i]; | |
} |
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> | |
using namespace std; | |
int num_comp = 0; | |
const int MAX = 500000; | |
int L[MAX/2 + 2]; | |
int R[MAX/2 + 2]; | |
const int SENTINEL = 2000000000; |
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> | |
using namespace std; | |
// Exchange | |
void exchange(int A[], int i, int j) | |
{ | |
int tmp = A[i]; | |
A[i] = A[j]; | |
A[j] = tmp; |
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 <string> | |
using namespace std; | |
struct { | |
unsigned int num; | |
char s; | |
}typedef card; |
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> | |
const int K = 10000; | |
// Countingsort | |
void countingsort(int A[], int B[], int n) | |
{ | |
int C[10001]; | |
// Initialize | |
for (int i = 0; i <= K; i++) |
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> | |
// Bubblesort | |
void bubblesort(int A[], int n) | |
{ | |
for (int i = 0; i < n; i++) { | |
for (int j = n - 1; j > 0; j--) { | |
if (A[j] < A[j - 1]) { | |
int tmp = A[j]; | |
A[j] = A[j - 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 <string> | |
struct { | |
int parent; | |
int child; | |
int sibling; | |
} typedef node; | |
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 <string> | |
struct { | |
int parent; | |
int left; | |
int right; | |
} typedef node; |
OlderNewer