Algorithms - Implement Bubble Sort

Tell us what’s happening:
I didn’t understand from the instruction:

Instructions: Write a function bubbleSort which takes an array of integers as input and returns an array of these integers in sorted order from least to greatest.

Am I supposed to mutate the array input parameter inside this function?
Or it’s better to create a copy?
Does it matter in this challenge at all?
It’s better to know before starting implementation, that’s why I am asking before writing any code. Thanks.

  **Your code so far**
function bubbleSort(array) {
// Only change code below this line
return array;
// Only change code above this line
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Algorithms - Implement Bubble Sort

Link to the challenge:

I did it with mutation, it works. I guess original question is not needed to be answered, will mark it as solved.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.