Skip to content

Instantly share code, notes, and snippets.

View galek's full-sized avatar
🧭
I'm ready for new discoveries

Nikolay Galko galek

🧭
I'm ready for new discoveries
View GitHub Profile
@galek
galek / gist:bd1e38e03022ada4b1ef
Created May 14, 2015 22:36
manacher algorithm linear time longest palindromic substring
//Based on http://www.geeksforgeeks.org/manachers-algorithm-linear-time-longest-palindromic-substring-part-4/
// A C program to implement Manacher’s Algorithm
#include <stdio.h>
#include <string.h>
char text[100];
int min(int a, int b)
{
int res = a;
if (b < a)
@galek
galek / game_loop.cpp
Last active August 29, 2015 14:20 — forked from jakemco/game_loop.cpp
const int TICKS_PER_SECOND = 25;
const int MS_PER_TICK = 1000 / TICKS_PER_SECOND;
const int MAX_SKIPPED_FRAMES = 5;
void EngineInstance::run() {
this->last_tick_time = getTime() - TICKS_PER_SECOND;
while (this->shouldKeepRunning()) {
this->checkForUpdate();