Presentation is loading. Please wait.

Presentation is loading. Please wait.

2 code samples int [] array; int i, j, temp; for(i = 0; i < array.length/2; i++) { j = array.length-1-i; temp = array[i]; array[i] = array[j]; array[j]

Similar presentations


Presentation on theme: "2 code samples int [] array; int i, j, temp; for(i = 0; i < array.length/2; i++) { j = array.length-1-i; temp = array[i]; array[i] = array[j]; array[j]"— Presentation transcript:

1 2 code samples int [] array; int i, j, temp; for(i = 0; i < array.length/2; i++) { j = array.length-1-i; temp = array[i]; array[i] = array[j]; array[j] = temp; } int [] array; int i, j, temp; for(i = 0; i < array.length/2; i*=2) { j = array.length-1-i; temp = array[i]; array[i] = array[j]; array[j] = temp; } Running time Asymptotic Analysis: O( ) notation Systems: Summation of (number of operations) * (cost per operation) Ex: load, add, subtract, store Memory Asymptotic Analysis: O( ) notation, how many primitives are stored Systems: Number of bits for all variables declared


Download ppt "2 code samples int [] array; int i, j, temp; for(i = 0; i < array.length/2; i++) { j = array.length-1-i; temp = array[i]; array[i] = array[j]; array[j]"

Similar presentations


Ads by Google