Merikanto

一簫一劍平生意,負盡狂名十五年

QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many versions of QuickSort that pick pivot(s) in different ways. Here I’m going to show 4 ways of implementing QuickSort in Python.

Weiterlesen »

规则: 将一副扑克牌平均分成两份,每人拿一份。小K先拿出手上的第一张扑克牌放在桌子上,然后小Q也拿出手上的第一张扑克牌,放在小K刚打出的牌上面,就这样两人交替出牌。出牌时,如果某人打出的牌与桌上的牌的牌面相同,即可将两张相同的牌及其中间所加的牌全部取走,并依次放到自己手中牌的末尾,当任意一人手中的牌全部出完时,游戏结束,对手获胜。

Weiterlesen »

Many tasks in Linux are running day and night, regardless when people are asleep or not. So in order to run some processes automatically and periodically, we need to resort to Linux’s Crontab.

Weiterlesen »