as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write pseudo-code for a bubble sort algorithm
user
procedure bubblesort( a : list of sortable items )
  n = length(a)
  repeat 
    swapped = false
    for i = 1 to n-1 inclusive do
      if a[i-1] > a[i] then
        swap(a[i-1], a[i])
        swapped = true
      end if
    end for
    n = n - 1
  until not swapped
end procedure
assistant