Skip to content

Instantly share code, notes, and snippets.

View LifeMoroz's full-sized avatar

Galimov Ruslan LifeMoroz

View GitHub Profile
#include <vector>
#include <string>
#include <iostream>
#include <stdio.h>
using namespace std;
struct HashNode;
int Insert(vector<HashNode> *&table, HashNode elem);
typedef unsigned int int_t;
struct HashNode {
#include <iostream>
#include <vector>
#include "math.h"
using namespace std;
#define INT_MAX1 2147483647
class Elem{
public:
int color;
#include <iostream>
#include <vector>
using namespace std;
struct CNode {
CNode(int k) :
key(k), height(1), count(1),
Left(NULL), Right(NULL)
{
}
#include <iostream>
using namespace std;
struct CNode {
CNode(int k) :
key(k), left(NULL), right(NULL), height(1)
{
}
int key;
#include<vector>
#include<math.h>
#include<iostream>
#include<utility>
struct Pair {
int elem;
int index;
Pair(int e, int i) : elem(e), index(i) {}
Pair() : elem(0), index(0) {}
@LifeMoroz
LifeMoroz / tehcs.txt
Last active December 29, 2015 21:59
Описание выбора технологий
Обоснования применения технологий
# REDIS
Обоснование выбора технологии:
Небходимость хранить теги
Нужны каналы для риалтайм сообщений
Использовано в качестве:
Теги
Реляционные БД не очень подходят для хранения тегов
#include <stdio.h>
class Tree {
protected:
class Node {
private:
int _value;
#include <stdio.h>
using namespace std;
class Node {
private:
int _value;
Node *_left;
Node *_right;
public:
@LifeMoroz
LifeMoroz / gist:7453262
Last active December 28, 2015 05:58
Project collapse
#include <stdio.h>
#include <vector>
class Impact;
struct Circle
{
float x, y, r;
};
@LifeMoroz
LifeMoroz / 4rd
Last active December 27, 2015 21:19
Added description
#include <stdio.h>
#include <stdint.h>
#include <algorithm>
#include <vector>
int size = 0;
void Heapify(int* arr, int i) {
int left = 2 * i + 1; int right = 2 * i + 2; // Ищем большего сына, если такой есть.
int largest = i;
if (left < size && arr[left] > arr[i])