Amazon Q Developer는 일반적인 알고리즘에 대한 코드 제안을 제공할 수 있습니다.
예시 #1
버블 정렬
일반적인 프롬프트
createabubble_sortfunction
Python 프롬프트
VSCode에서 파일을 생성하고 이름을 bubble_sort.py 로 지정하고 다음 코드를 입력합니다.
# create a bubble_sort function
Amazon Q Developer 제안
defbubble_sort(array):# loop through the arrayforiinrange(len(array)):# loop through the array againforjinrange(len(array)):# if the element is greater than the next element, swap themifarray[i]>array[j]:array[i],array[j]=array[j],array[i]returnarray