Time Complexity a simple understanding of time complexity is the number of statements executed. If loops and Recursion exist, ignore simple statements and calculate the number of cycles and Recursion statement executions. For example: [java] int x = 1; // the time complexity is O (1) for (int I = 0; I <n; I ++) {System. out. println (I);} // the time complexity is O (n). For example: 1. O (1) [java] int x = 1; 2. O (n) [java] for (int I = 0; I <n; I ++) {System. out. println (I) ;}3, O () [html] int n = 8, count = 0; for (int I = 1; I <= n; I * = 2) {count ++;} 4. [html] int n = 8, count = 0; for (int I = 1; I <= n; I ++) {for (int j = 1; j <= n; j ++) {count ++;} 5. [java] view plaincopyint n = 8, count = 0; for (int I = 1; I <= n; I * = 2) {for (int j = 1; j <= n; j ++) the {count ++;} example is relatively simple. Space complexity space complexity is also easily understood as the storage space occupied by temporary variables. A simple example: [java] // exchange two variables x and y int x = 1, y = 2; int temp = x; x = y; y = temp; A temporary variable temp, so the space complexity is O (1 ).