A question concerning algorithms

  • Thread starter Thread starter wajed
  • Start date Start date
  • Tags Tags
    Algorithms
AI Thread Summary
The discussion centers on clarifying two questions related to an algorithm involving arrays. The first question addresses whether the array in question refers to a sub-array of sorted numbers, indicating a focus on how elements are managed during sorting. The second question seeks to define the variable "i," which is not explicitly mentioned in the accompanying text but is present in the code. It is clarified that "i" is declared in line 4 and is equal to "j - 1." The explanation emphasizes that the phrase "with at most ... at any time" refers to storing certain values outside the main array, specifically to preserve data during rearrangements of the array A. This highlights the algorithm's efficiency in managing memory while sorting.
wajed
Messages
56
Reaction score
0
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)
 
Last edited by a moderator:
Technology news on Phys.org
"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 ).
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top