摘要:
f_in = open("in.txt", "r")f_out = open("out.txt", "w")INDENT = 4brace_count = 0#number of {bracket_count=0write_for_brakcet = Falsefor line in f_in: for i in range(len(line)): if write_for_brakcet: if line[i]==']': write_for_brakcet = False f_out.write 阅读全文
摘要:
二分查找def bin_sort(l_head,l_index): length = len(l_head) for i in range(length-1): if i == 0: continue else: head = 0 tail = i - 1 temp_h = l_head[i] temp_i = l_index[i] while head <= tail: mid = (head+tail)/2 if(l_head[mid]<temp_h): head = ... 阅读全文