PDA

View Full Version : a question concerning algorithms


wajed
Oct6-09, 05:14 PM
http://img207.imageshack.us/img207/8504/questionw.jpg


1st question: "with at most a constant number of them stored outside the array any time."
Is that array the sub-array of the sorted numbers?

2nd question: what does the "i" represent? it`s not even mentioned in the text (only in the code)

ApexOfDE
Oct6-09, 09:32 PM
"with at most ... at any time" means that value of member jth of A will be stored in variables outside of A (in this case, k). This step helps you save the value when you rearrange the array A, i think.

Variables i is declared in line 4 (like j declared in line 1). i is equal to (j - 1 ).