Update quick_sort.md

Fix the Golang code for median
pull/259/head
dshlstarr 2 years ago committed by GitHub
parent 33e84ff50b
commit ea3eee8b87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -483,7 +483,7 @@ comments: true
func medianThree(nums []int, left, mid, right int) int {
if (nums[left] > nums[mid]) != (nums[left] > nums[right]) {
return left
} else if (nums[mid] < nums[left]) != (nums[mid] > nums[right]) {
} else if (nums[mid] > nums[left]) != (nums[mid] > nums[right]) {
return mid
}
return right

Loading…
Cancel
Save