原创 C語言實現歸併排序

歸併排序寫在前面歸併排序算法的實現歸併排序效率分析 寫在前面 基本思想:歸併(Merge)排序法是將兩個(或兩個以上)有序表合併成一個新的有序表,即把待排序序列分爲若干個子序列,每個子序列是有序的。然後再把有序子序列合併爲整體有序

原创 字符串匹配算法

字符串匹配寫在前面KMP算法Sunday算法 寫在前面        隨着越來越多高級語言的出現,字符串模式匹配均可以直接調用庫函數實現。雖然這些函數用起來很方便,但是我覺得字符串匹配的相關算法,還是需要掌握的,這裏我就參考了網上

原创 十大經典排序算法

原文鏈接:https://blog.csdn.net/u012562943/article/details/100136531 算法學習總結(2)——溫故十大經典排序算法

原创 [LeetCode]383. Ransom Note ★

每天一道編程題題目描述樣例python解法C語言解法 題目描述 Given an arbitrary ransom note string and another string containing letters from al

原创 [LeetCode]374. Guess Number Higher or Lower ★

每天一道編程題題目描述樣例python解法C++語言解法 題目描述 We are playing the Guess Game. The game is as follows: I pick a number from 1 to

原创 [LeetCode]367. 有效的完全平方數 ★

每天一道編程題題目描述樣例python解法C語言解法 題目描述 給定一個正整數 num,編寫一個函數,如果 num 是一個完全平方數,則返回 True,否則返回 False。 說明:不要使用任何內置的庫函數,如 sqrt。 樣例

原创 [LeetCode]350. Intersection of Two Arrays II ★

每天一道編程題題目描述樣例python解法C語言解法 題目描述 Given two arrays, write a function to compute their intersection. 題目大意:求兩個數組的全部交集,重

原创 [LeetCode]242. Valid Anagram ★

每天一道編程題題目描述樣例python解法C語言解法 題目描述 Given two strings s and t , write a function to determine if t is an anagram of s.

原创 [LeetCode]278. First Bad Version ★

每天一道編程題題目描述樣例python解法C語言解法 題目描述 You are a product manager and currently leading a team to develop a new product. Un

原创 [LeetCode]268. Missing Number ★

每天一道編程題題目描述樣例python解法C語言解法 題目描述 Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one

原创 [LeetCode]326. Power of Three ★

每天一道編程題題目描述樣例python解法C語言解法 題目描述 Given an integer, write a function to determine if it is a power of three. 題目大意:給定一

原创 python的可變參數和關鍵字參數(*args **kw)

原文鏈接:https://www.jianshu.com/p/98f7e34845b5 可變參數、關鍵字參數、命名關鍵字參數可變參數關鍵字參數命名關鍵字參數不允許使用關鍵字參數的內置函數

原创 [LeetCode]283. Move Zeroes ★

每天一道編程題題目描述樣例python解法C語言解法 題目描述 Given an array nums, write a function to move all 0’s to the end of it while mainta

原创 [LeetCode]349. Intersection of Two Arrays ★

每天一道編程題題目描述樣例python解法C語言解法 題目描述 Given two arrays, write a function to compute their intersection. 題目大意:求兩個給定集合的交集 樣

原创 [LeetCode]290. Word Pattern ★

每天一道編程題題目描述樣例python解法 題目描述 Given a pattern and a string str, find if str follows the same pattern. Here follow mean