摘要: 1)查找第N小的值2)查找最小最大值#!/usr/bin/env python3.3# -*- coding:utf-8 -*-# Copyright 2013def randomized_select(data, n): if n > 0 and n 0: min_value = max_value = data[0] start_pos = 0 if len(data) % 2 == 0 else 1 for i in range(start_pos, len(data)-1, 2): if data[i] max_... 阅读全文
posted @ 2013-03-25 20:10 Leung文 阅读(178) 评论(0) 推荐(0) 编辑