Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Dennis Huillca Portilla dennisbot

🎯
Focusing
View GitHub Profile
@dennisbot
dennisbot / cloudSettings
Last active Feb 27, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2020-02-27T17:10:38.302Z","extensionVersion":"v3.4.3"}
@dennisbot
dennisbot / database.yml
Created Feb 2, 2018
postgre database for ruby on rails
View database.yml
# PostgreSQL. Versions 8.2 and up are supported.
#
# Install the pg driver:
# gem install pg
# On Mac OS X with macports:
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
# On Windows:
# gem install pg
# Choose the win32 build.
# Install PostgreSQL and put its /bin directory on your path.
@dennisbot
dennisbot / strtok.c
Created Jul 31, 2017
parsing a string with C programming language strtok.c
View strtok.c
char *st,*buf, sep[]=" .,";
buf=strdup(s.c_str());
st=strtok(buf,sep);
while (st) {
st=strtok(0,sep);
}
@dennisbot
dennisbot / MyHeap.cpp
Created Jun 23, 2017
una implementación de minHeap y maxHeap con C++
View MyHeap.cpp
#include <vector>
using namespace std;
#define db(a) cout << #a << " = " << a << endl
#define db2(a, b) cout << #a << " = " << a << " " << #b << " = " << b << endl;
template<typename T> class MyHeap {
protected:
int capacity;
@dennisbot
dennisbot / Graph_class.cpp
Created Jun 23, 2017
Implementación de un Grafo con Matrices e incluye método para buscar alcance mínimo a otros vértices
View Graph_class.cpp
class Graph {
private:
int **G;
int size;
public:
Graph(int n) {
n++;
G = new int*[n];
for (int i = 0; i < n; i++) {
G[i] = (int*)calloc(n, sizeof(int));
View MergeSort.cpp
void merge(vector<int> &a, vector<int> &temp, int mid, int leftStart, int rightEnd) {
int leftEnd = mid;
int rightStart = leftEnd + 1;
int curIndex = leftStart, left = leftStart;
for (;leftStart <= leftEnd && rightStart <= rightEnd;) {
if (a[leftStart] <= a[rightStart])
temp[curIndex++] = a[leftStart++];
else
temp[curIndex++] = a[rightStart++], res += leftEnd - leftStart + 1;
}
View Trie.cpp
template <typename T>
class Trie {
private:
T count;
Trie<T> *next[26];
public:
Trie() {
count = T();
for (int i = 0; i < 26; i++) next[i] = NULL;
}
View Add EOL Semicolon.sublime-macro
[
{"command": "move_to", "args": {"to": "hardeol"}},
{"command": "insert", "args": {"characters": ";"}}
]