Implement the Bubble Sort Algorithm with Patterns and Rules

    
Generate a sample dataset:
Use ReplaceRepeated (//.) to implement the bubble sort:
Verify the result by comparing it with the Sort function: