Human-written demonstration (OpenAssistant volunteers)· OpenAssistant (human-written)
OpenAssistant Conversations (oasst2)
Write a bubble sort in Rust
In OpenAssistant data, “assistant” turns were written by human volunteers as demonstrations. They are not model outputs.
- User
Write a bubble sort in Rust
- Assistant
Bubble sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. This is repeated until the list is sorted.
Here’s an example of bubble sort in Rust:
fn bubble_sort(mut list: Vec<i32>) -> Vec<i32> { let n = list.len(); for i in 0..n { for j in 0..n-i-1 { if list[j] > list[j+1] { list.swap(j, j+1); } } } }This function takes a vector of integers as an input argument and returns a sorted vector using the bubble sort algorithm.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)