ID
ha35gkakfdrgm0cgjf4rm0gfm8
Status
Succeeded
Source
Web
Hardware
A40 (Large)
Total duration
Created
Webhook

Input

prompt
write a quick sort algorithm in python.
system_prompt
You are an expert software engineer proficient in multiple programming languages.
min_tokens
0
max_tokens
512
temperature
0.6
top_p
0.9
top_k
50
presence_penalty
0
frequency_penalty
0

Output


def quick_sort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[len(arr) // 2]
    left = [x for x in arr if x < pivot]
    middle = [x for x in arr if x == pivot]
    right = [x for x in arr if x > pivot]
    return quick_sort(left) + middle + quick_sort(right)

print(quick_sort([3,6,8,10,1,2,1]))
Generated in