Question from the Algorithmics - Fundamentals test

What does the While loop do?

Hard

What does the While loop do?

sort_insertion(Array listNumbers) 
{
  For i from 1 to size_of_listNumbers - 1 
  {
    x <-- listNumbers[i];
    j <-- i;
    While j > 0 and listNumbers[j - 1] > x 
    {
      listNumbers[j] <-- listNumbers[j - 1]
      j <-- j-1;
    }
    listNumbers[j] <-- x;
  }
}
Author: AdrienStatus: Published(Update)Question passed 631 times
Edit
5
Community EvaluationsNo one has reviewed this question yet, be the first!