Skip to content

Instantly share code, notes, and snippets.

View limboinf's full-sized avatar
🎯
Focusing

limbo limboinf

🎯
Focusing
View GitHub Profile
@limboinf
limboinf / string.c
Last active January 11, 2017 09:44
数据结构之:串
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define OK 1
#define ERROR 0
#define TRUE 1
#define FALSE 0
#define MAXSIZE 40 /* 存储空间初始分配量 */
@limboinf
limboinf / huiwen.py
Created January 4, 2017 03:27
回文
# coding=utf-8
n = int(raw_input().strip())
item = [int(x) for x in raw_input().strip().split()]
def huiwen(item, head, tail):
times=0
left = item[head]
right = item[tail]
while (head < tail):
@limboinf
limboinf / gen_avatar.py
Created January 3, 2017 07:21
Python生成1-9宫格头像
# coding=utf-8
__author__ = 'fang'
import os
import uuid
import time
from common.qn import qiNiu
import urllib2
import cStringIO
from PIL import Image
from settings import image_collections
@limboinf
limboinf / 链队列.c
Created December 28, 2016 07:26
数据结构:链对
//
// Created by 方朋 on 16/12/20.
//
#include <stdio.h>
#include <stdlib.h>
#include "global.h"
/*
@limboinf
limboinf / 顺序队列.c
Created December 28, 2016 05:44
数据结构:顺序队列
//
// Created by 方朋 on 16/12/20.
//
#include <stdio.h>
#include <stdlib.h>
#include "global.h"
/*
@limboinf
limboinf / 队列.c
Created December 24, 2016 14:44
数据结构:队列
/*
* ADT 队列(Queue)
* Data
* 同线性表。元素具有相同的类型,相邻元素具有前驱和后继关系。
* Operation
* InitQueue(*Q) // 初始化, 建立一个空队列
* DestroyQueue(*Q) // 若Q存在则销毁队列
* ClearQueue(*Q) // 将队列Q清空
* QueueEmpty(Q) // 是否为空
@limboinf
limboinf / 链栈.c
Created December 24, 2016 09:03
数据结构:链栈
//
// Created by 方朋 on 16/12/20.
//
#include <stdio.h>
#include <stdlib.h>
#include "global.h"
/*
@limboinf
limboinf / 两顺序栈共享空间.c
Created December 24, 2016 07:32
数据结构:两栈共享空间
//
// Created by 方朋 on 16/12/20.
//
#include <stdio.h>
#include "global.h"
/*
* ADT 栈(stack)
@limboinf
limboinf / 顺序栈.c
Created December 23, 2016 09:46
数据结构:顺序栈
#include <stdio.h>
#include "global.h"
/*
* ADT 栈(stack)
* InitStack(*S) // 初始化一个空栈S
* DestoryStack(*S) // 若栈存在则销毁
* ClearStack(*S) // 将栈清空
* StackEmpty(S) // 是否为空
@limboinf
limboinf / thread_pools.py
Created December 23, 2016 05:52
Python线程池
# coding=utf-8
"""
线程池.
:copyright: (c) 2015 by fangpeng.
:license: MIT, see LICENSE for more details.
"""
import sys
import Queue
import threading