Skip to content
No description or website provided.
C++
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
FindMedian.cpp
README.md

README.md

两个sorted array,A和B,找到他们的中位数

中位数的定义:如果有奇数个元素,取第 (n+1)/2那个,如果有偶数个元素,中位数的值为第n/2 + 第(n+1)/2除以2

两个局部变量记录两个数组的下标,一个标志量记录步长,移动了相应步长之后,根据元素个数的奇偶来取值,该值就为中位数

Something went wrong with that request. Please try again.