摘要:
##今天在网易二面的时候,面试官出了一道个人感觉很有意思的面试题,现在分享给大家,看大家有没有什么好的其他的思路 问题:给定一个test.txt的日志文件,文件的内容如下: 20201011 103232 Exception: Null Pointer 20201011 101433 Excepti 阅读全文
posted @ 2021-01-07 19:32
felixtester
阅读(214)
评论(0)
推荐(0)
摘要:
采用两种方式,完成斐波那契数列的程序 ##非递归方式 def fib(n): a, b = 1, 2 if n == 0: return None if n <= 2: return 1 while n > 2: a, b = b, a+b n -= 1 return a ##递归调用 def fi 阅读全文
posted @ 2021-01-07 11:43
felixtester
阅读(199)
评论(0)
推荐(0)
摘要:
##归并排序,时间复杂度O(nlogn) def list_split(list): if len(list) < 2: return list else: mid = int(len(list)/2) leftlist = list_split(list[:mid]) rightlist = li 阅读全文
posted @ 2021-01-07 11:39
felixtester
阅读(75)
评论(0)
推荐(0)
摘要:
提供两个思路的快速排序,时间复杂度O(nlogn),最差情况为O(n*n) ##固定位置快速排序 def kuaisu(list): if len(list) < 2: return list else: temp = list[0] leftlist = [x for x in list[1:] 阅读全文
posted @ 2021-01-07 11:35
felixtester
阅读(83)
评论(0)
推荐(0)

浙公网安备 33010602011771号