This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by 方朋 on 16/12/20. | |
// | |
#include <stdio.h> | |
#include "global.h" | |
// 数组要尽量建大点,这里假设链表最大长度1000 | |
#define MAXSIZE 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
""" | |
线程池. | |
:copyright: (c) 2015 by fangpeng. | |
:license: MIT, see LICENSE for more details. | |
""" | |
import sys | |
import Queue | |
import threading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "global.h" | |
/* | |
* ADT 栈(stack) | |
* InitStack(*S) // 初始化一个空栈S | |
* DestoryStack(*S) // 若栈存在则销毁 | |
* ClearStack(*S) // 将栈清空 | |
* StackEmpty(S) // 是否为空 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by 方朋 on 16/12/20. | |
// | |
#include <stdio.h> | |
#include "global.h" | |
/* | |
* ADT 栈(stack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by 方朋 on 16/12/20. | |
// | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "global.h" | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ADT 队列(Queue) | |
* Data | |
* 同线性表。元素具有相同的类型,相邻元素具有前驱和后继关系。 | |
* Operation | |
* InitQueue(*Q) // 初始化, 建立一个空队列 | |
* DestroyQueue(*Q) // 若Q存在则销毁队列 | |
* ClearQueue(*Q) // 将队列Q清空 | |
* QueueEmpty(Q) // 是否为空 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by 方朋 on 16/12/20. | |
// | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "global.h" | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by 方朋 on 16/12/20. | |
// | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "global.h" | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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): |