数据结构
Lintongzg
这个作者很懒,什么都没留下…
展开
-
python实现二分查找
N = int(input()) st = input() F = int(input()) ls = st.split() ls = [int(l) for l in ls] N = N//2 m=N def newn(n,ls): n = len(ls) n = n // 2 re...原创 2018-09-05 11:02:00 · 427 阅读 · 0 评论 -
01-复杂度1 最大子列和问题
给定K个整数组成的序列{ N1, N2, ..., NK },“连续子列”被定义为{ Ni, Ni+1, ..., Nj },其中 1≤i≤j≤K。“最大子列和”则被定义为所有连续子列元素的和中最大者。例如给定序列{ -2, 11, -4, 13, -5, -2 },其连续子列{ 11, -4, 13 }有最大的和20。现要求你编写程序,计算给定整数序列的最大子...原创 2018-09-05 11:18:24 · 367 阅读 · 0 评论 -
01-复杂度2 Maximum Subsequence Sum
Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequen...原创 2018-09-06 19:28:32 · 411 阅读 · 0 评论