Time Complexity
Example 1
The above is
Example 2
The above is
Example 3
The above is
Example 4
The above is
Example 5
The above is
Example 6
The above is
Example 7
The above is
Example 8
The above is
Example 9
The above is
Example 10
The above is
Example 1
- x = n
- while ( x > 0 ) {
- x = x - 1
- }
The above is
Example 2
- x = n
- while ( x > 0 ) {
- x = x / 2
- }
The above is
Example 3
- x = n
- while ( x > 0 ) {
- y = n
- while ( y > 0 ) {
- y = y - 1
- }
- x = x - 1
- }
The above is
Example 4
- x = n
- while ( x > 0 ) {
- y = x
- while ( y > 0 ) {
- y = y - 1
- }
- x = x - 1
- }
The above is
Example 5
- x = n
- while ( x > 0 ) {
- y = n
- while ( y > 0 ) {
- y = y / 2
- }
- x = x - 1
- }
The above is
Example 6
- x = n
- while ( x > 0 ) {
- y = x
- while ( y > 0 ) {
- y = y / 2
- }
- x = x - 1
- }
The above is
Example 7
- x = n
- while ( x > 0 ) {
- y = n
- while ( y > 0 ) {
- y = y - 1
- }
- x = x / 2
- }
The above is
Example 8
- x = n
- while ( x > 0 ) {
- y = x
- while ( y > 0 ) {
- y = y - 1
- }
- x = x / 2
- }
The above is
Example 9
- x = n
- while ( x > 0 ) {
- y = n
- while ( y > 0 ) {
- y = y / 2
- }
- x = x / 2
- }
The above is
Example 10
- x = n
- while ( x > 0 ) {
- y = x
- while ( y > 0 ) {
- y = y / 2
- }
- x = x / 2
- }
The above is