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 <stdio.h> | |
#include <stdlib.h> | |
#include <iostream> | |
#include <algorithm> | |
int get_median(int* a, int s) | |
{ | |
if(s % 2 == 0) | |
{ | |
return (a[s/2] + a[s/2 - 1]) / 2; |
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 <queue> | |
#include <stdlib.h> | |
struct node | |
{ | |
struct node* left; | |
struct node* rigth; | |
int data; |
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 <queue> | |
#include <stdlib.h> | |
struct node | |
{ | |
struct node* left; | |
struct node* rigth; | |
int data; | |
}; |
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 <queue> | |
#include <stdlib.h> | |
struct node | |
{ | |
struct node* left; | |
struct node* rigth; | |
struct node* parent; |
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 <stdlib.h> | |
struct node | |
{ | |
struct node* left; | |
struct node* right; | |
int data; | |
}; |
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> | |
int main() | |
{ | |
int a[8]; | |
const char c = 'a'; | |
for(unsigned int i = 0; i < sizeof(char)*8; ++i) | |
{ | |
if(c & (1 << 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
#include <iostream> | |
class heap | |
{ | |
private: | |
int size; | |
private: | |
int get_left(int i); | |
int get_rigth(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
#include <iostream> | |
#include <limits.h> | |
#include <stdlib.h> | |
#include <queue> | |
struct node | |
{ | |
int d; | |
int w; |
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 <vector> | |
double vagner_fisher_sed_algo(const std::string& s, | |
const std::string& d) | |
{ | |
std::vector<std::vector<double> > t(s.length() + 1, | |
std::vector<double>(d.length() + 1)); | |
t[0][0] = 0; | |
double o; |
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
void backtrack(int* a, int k, int n) | |
{ | |
if (k == n) | |
{ | |
for(int i = 1; i <=k; ++i) | |
{ | |
if (a[i] == true) | |
{ | |
std::cout << i << " "; | |
} |
OlderNewer