Skip to content

Instantly share code, notes, and snippets.

View thinkphp's full-sized avatar
💭
If I have seen further it is only by standing on the shoulders of giants. Newton

Adrian Statescu thinkphp

💭
If I have seen further it is only by standing on the shoulders of giants. Newton
View GitHub Profile
@thinkphp
thinkphp / queue.c
Created December 11, 2019 19:32
Queue Data Structure
/**
* Queue Data Structure implemented as Array
*/
#include <stdio.h>
#define QUEUE_MAX 5
//declare my queue and two pointers to this data structure
int queue[ QUEUE_MAX ],
front = -1,
rear = -1;
@thinkphp
thinkphp / stack.c
Last active December 4, 2019 19:27
/**
* Author: Adrian Statescu <mergesortv@gmail.com>,<http://adrianstatescu.com>
* Description: Efficient Data Structure for storing and retrieving data in a Last-In, first-out;
* This allow us to retrieve data in opposite order as it was stored.
*/
#include <stdio.h>
#define STACK_MAX 100
#define FIN "scarface.in"
struct Stack {
@thinkphp
thinkphp / curl_php.bash
Created December 26, 2018 21:38
install curl_php
enabled in php.ini
sudo apt-get install php7.0-curl
sudo /etc/init.d/apache2 restart
@thinkphp
thinkphp / exfat install
Created December 18, 2018 14:28
installxfat.bash
sudo apt-get install exfat-fuse exfat-utils
@thinkphp
thinkphp / gcloudAppDeploy.bash
Last active December 13, 2018 14:27
gcloud app deploy
dev_appserver.py app.yaml
gcloud app deploy
@thinkphp
thinkphp / find.bash
Created December 9, 2018 18:23
Find all the files created today with specific extentions.
find . -name "*.cpp" -ctime -1
@thinkphp
thinkphp / perm.rb
Created December 9, 2018 11:14
backtracking in ruby. display the perm
@n = 3
@stack = [0]*(@n)
def valid(level)
for i in 1..level-1
if @stack[i] == @stack[level]
@thinkphp
thinkphp / iteratorCombSort.cpp
Created December 6, 2018 10:00
ComboSort using vector<int>::iterator, pointer to function and fread for reading from std
#include <bits/stdc++.h>
#include <algorithm>
#define FIN "algsort.in"
#define FOUT "algsort.out"
#define b 1000000
using namespace std;
typedef vector<int>::iterator I;
typedef void (*fnPtr)(vector<int>, I, I);
@thinkphp
thinkphp / combosort.cpp
Created December 5, 2018 20:32
combosort using IO struct
include <bits/stdc++.h>
#define FIN "algsort.in"
#define FOUT "algsort.out"
#define L 1000000
using namespace std;
struct IO {
char *buff, *p, *s;
@thinkphp
thinkphp / parallel.hs
Created November 27, 2018 10:00
good support for parallel programming
ghc file.hs --make -threaded -rtsopts