mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-25 01:16:31 +08:00
Update quick_sort.md
Fix the Golang code for median
This commit is contained in:
parent
33e84ff50b
commit
ea3eee8b87
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue