随笔分类 -  c语常识

摘要:如何判断一个算法的好坏? 时间和空间 时间复杂度:时间增长的趋势 T(n)=O(f(n)) 一般情况下时间复杂度未知数都是用N,但是也可以用M、K等等其他 空间复杂度:内存空间增长的趋势,O(1)、O(n)、O(n^2) O(1)空间复杂度如:int x=0;int y=0;x++;y++; O(n 阅读全文
posted @ 2022-09-23 23:35 一树懒 阅读(27) 评论(0) 推荐(0)
摘要:#include <stdio. h> int fun( int a ) { int b = 0; static int c = 3; a = ( c + +,b + + ); return ( a ); } main( ) { int a = 2,i,k; for( i = 0;i&l 阅读全文
posted @ 2022-09-16 19:12 一树懒 阅读(28) 评论(0) 推荐(0)