吐槽下天猫 app

2016-06-11 14:10:37 +08:00
 czheo
首页向左滑向右滑用户看来根本是鸡肋。这算 ABtest ?两个页面看不出啥大差别,根本无所谓。不知道的用户还会纳闷下。
为了 metrics driven 而硬做 ABtest 和为了 test driven 而破坏代码结构一样,都是本末倒置。
252 次点击
所在节点    自言自语
4 条回复
czheo
2017-02-01 19:32:38 +08:00
``` python
def quick_sort(numbers,left,right):
if right - left <= 0:
return numbers

tmp = numbers[left]
i = left + 1
j = right

while i < j:
while numbers[j] > tmp and i < j:
j -= 1
while numbers[i] <= tmp and i < j:
i += 1
numbers[i], numbers[j] = numbers[j], numbers[i]

if numbers[i] > numbers[left]:
numbers[i-1], numbers[left] = numbers[left], numbers[i-1]
else:
numbers[i], numbers[left] = numbers[left], numbers[i]

quick_sort(numbers,left,i-1)
quick_sort(numbers,i+1,right)

return numbers

test = [3,7,8,5,1,2,2,2,22,11,5,4]
print(quick_sort(test, 0, len(test) - 1))
```
czheo
2017-02-01 19:32:48 +08:00
```
def quick_sort(numbers,left,right):
if right - left <= 0:
return numbers

tmp = numbers[left]
i = left + 1
j = right

while i < j:
while numbers[j] > tmp and i < j:
j -= 1
while numbers[i] <= tmp and i < j:
i += 1
numbers[i], numbers[j] = numbers[j], numbers[i]

if numbers[i] > numbers[left]:
numbers[i-1], numbers[left] = numbers[left], numbers[i-1]
else:
numbers[i], numbers[left] = numbers[left], numbers[i]

quick_sort(numbers,left,i-1)
quick_sort(numbers,i+1,right)

return numbers

test = [3,7,8,5,1,2,2,2,22,11,5,4]
print(quick_sort(test, 0, len(test) - 1))
```
czheo
2017-02-01 19:33:00 +08:00
~~~
def quick_sort(numbers,left,right):
if right - left <= 0:
return numbers

tmp = numbers[left]
i = left + 1
j = right

while i < j:
while numbers[j] > tmp and i < j:
j -= 1
while numbers[i] <= tmp and i < j:
i += 1
numbers[i], numbers[j] = numbers[j], numbers[i]

if numbers[i] > numbers[left]:
numbers[i-1], numbers[left] = numbers[left], numbers[i-1]
else:
numbers[i], numbers[left] = numbers[left], numbers[i]

quick_sort(numbers,left,i-1)
quick_sort(numbers,i+1,right)

return numbers

test = [3,7,8,5,1,2,2,2,22,11,5,4]
print(quick_sort(test, 0, len(test) - 1))
~~~
czheo
2017-02-01 19:33:19 +08:00
~~~
def quick_sort(numbers,left,right):
if right - left <= 0:
return numbers

tmp = numbers[left]
i = left + 1
j = right

while i < j:
while numbers[j] > tmp and i < j:
j -= 1
while numbers[i] <= tmp and i < j:
i += 1
numbers[i], numbers[j] = numbers[j], numbers[i]

if numbers[i] > numbers[left]:
numbers[i-1], numbers[left] = numbers[left], numbers[i-1]
else:
numbers[i], numbers[left] = numbers[left], numbers[i]

quick_sort(numbers,left,i-1)
quick_sort(numbers,i+1,right)

return numbers

test = [3,7,8,5,1,2,2,2,22,11,5,4]
print(quick_sort(test, 0, len(test) - 1))
~~~

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/284900

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX